Subject: [PATCH cppi] build: avoid a compiler warning about _FORTIFY_SOURCE redefinition

From: "Dmitry V. Levin" <[email-masked]>
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