GNU bug report logs - #63172
[PATCH cppi] build: avoid a compiler warning about _FORTIFY_SOURCE redefinition

Previous Next

Package: cppi;

Reported by: "Dmitry V. Levin" <ldv <at> altlinux.org>

Date: Sat, 29 Apr 2023 08:11:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: "Dmitry V. Levin" <ldv <at> altlinux.org>
To: 63172 <at> debbugs.gnu.org
Cc: Jim Meyering <jim <at> meyering.net>
Subject: 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




This bug report was last modified 2 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.