Skip to contentSkip to conversation

mem: fix build

PATCH In review Thomas Monjalon 2 participants 3 messages Apr 26, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mem: fix build

Some compilers (on RHEL7 and CentOS7) were getting this error:
error: "RTE_EXEC_ENV_FREEBSD" is not defined [-Werror=undef]

Existence of a macro must be checked with "#ifdef" or "#if defined".

Fixes d72e4042c5eb ("mem: exclude unused memory from core dump")
---
 lib/librte_eal/common/eal_common_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/eal_common_memory.c +1 -1
index 9a797a4fa3..4c897a13f1 100644
@@ -42,7 +42,7 @@ static uint64_t system_page_sz;
 
 #ifdef RTE_EXEC_ENV_LINUX
 #define RTE_DONTDUMP MADV_DONTDUMP
-#elif RTE_EXEC_ENV_FREEBSD
+#elif defined RTE_EXEC_ENV_FREEBSD
 #define RTE_DONTDUMP MADV_NOCORE
 #else
 #error "madvise doesn't support this OS"
Signature · 1 line
2.26.0
Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Thomas Monjalon
Sent: Sunday, April 26, 2020 1:47 PM
To: [email protected]
Cc: [email protected]; Anatoly Burakov <[email protected]>; Li Feng <[email protected]>
Subject: [dpdk-dev] [PATCH] mem: fix build

Quoted 8 lines

Some compilers (on RHEL7 and CentOS7) were getting this error:
error: "RTE_EXEC_ENV_FREEBSD" is not defined [-Werror=undef]

Existence of a macro must be checked with "#ifdef" or "#if defined".

Fixes d72e4042c5eb ("mem: exclude unused memory from core dump")
Quoted 19 lines
---
 lib/librte_eal/common/eal_common_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/common/eal_common_memory.c +1 -2
index 9a797a4fa3..4c897a13f1 100644
@@ -42,7 +42,7 @@ static uint64_t system_page_sz;
 
 #ifdef RTE_EXEC_ENV_LINUX
 #define RTE_DONTDUMP MADV_DONTDUMP
-#elif RTE_EXEC_ENV_FREEBSD
+#elif defined RTE_EXEC_ENV_FREEBSD
 #define RTE_DONTDUMP MADV_NOCORE
 #else
 #error "madvise doesn't support this OS"
--
Quoted 1 line

2.26.0

Kindest regards
Raslan Darawsheh