bug-cppi
[Top][All Lists]
Advanced

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

[bug-cppi] bug#63172: [PATCH cppi] build: avoid a compiler warning about


From: Dmitry V. Levin
Subject: [bug-cppi] bug#63172: [PATCH cppi] build: avoid a compiler warning about _FORTIFY_SOURCE redefinition
Date: Sat, 29 Apr 2023 11:10:05 +0300

When compiler provides its own definition of _FORTIFY_SOURCE, it complains
about _FORTIFY_SOURCE being redefined:

./lib/config.h:35: error: "_FORTIFY_SOURCE" redefined [-Werror]
   35 |    # define _FORTIFY_SOURCE 2
      |
<built-in>: note: this is the location of the previous definition

* configure.ac (FORTIFY_SOURCE): Do not redefine _FORTIFY_SOURCE.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f2078b2..36d8c31 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,7 +78,7 @@ if test "$gl_gcc_warnings" = yes; then
   AH_VERBATIM([FORTIFY_SOURCE],
   [/* Enable compile-time and run-time bounds-checking, and some warnings,
       without upsetting glibc 2.15+. */
-   #if defined __OPTIMIZE__ && __OPTIMIZE__
+   #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
    # define _FORTIFY_SOURCE 2
    #endif
   ])
-- 
ldv





reply via email to

[Prev in Thread] Current Thread [Next in Thread]