[PATCH] build-sys: Eliminate _FORTIFY_SOURCE warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The warnings were produced because the command-line flag redefined the
value of _FORTIFY_SOURCE coming from the specs on some distributions,
including Fedora and Gentoo. So, undefine this macro before defining it.

As the warnings are now eliminated, the flag becomes harmless even for
-O0. So enable it unconditionally.

AX_APPEND_FLAG cannot be used in this case, as it would leave only
-U_FORTIFY_SOURCE and omit -D_FORTIFY_SOURCE=2.
---
 configure.ac | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index e75973f..e292c38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,10 +180,7 @@ AX_APPEND_COMPILE_FLAGS(
 # Only enable fastpath asserts when doing a debug build, e.g. from bootstrap.sh.
 AS_CASE([" $CFLAGS "], [*" -O0 "*], [], [AX_APPEND_FLAG(["-DFASTPATH"], [CPPFLAGS])])
 
-# Only set _FORTIFY_SOURCE when optimizations are enabled. If optimizations
-# are disabled, _FORTIFY_SOURCE doesn't do anything, and causes tons of
-# warnings during compiling on some distributions (at least Fedora).
-AS_CASE([" $CFLAGS "], [*" -O0 "*], [], [AX_APPEND_FLAG(["-D_FORTIFY_SOURCE=2"], [CPPFLAGS])])
+AS_VAR_APPEND([CPPFLAGS],[" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"])
 
 
 #### Linker flags ####
-- 
1.9.2



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux