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

To reply to this bug, email your comments to 63172 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-cppi <at> gnu.org:
bug#63172; Package cppi. (Sat, 29 Apr 2023 08:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Dmitry V. Levin" <ldv <at> altlinux.org>:
New bug report received and forwarded. Copy sent to bug-cppi <at> gnu.org. (Sat, 29 Apr 2023 08:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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




Information forwarded to bug-cppi <at> gnu.org:
bug#63172; Package cppi. (Sun, 30 Apr 2023 14:03:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Dmitry V. Levin" <ldv <at> altlinux.org>
Cc: bug-cppi <at> gnu.org
Subject: Re: [PATCH cppi] build: avoid a compiler warning about
 _FORTIFY_SOURCE redefinition
Date: Sun, 30 Apr 2023 16:01:40 +0200
On Sat, Apr 29, 2023 at 10:10 AM Dmitry V. Levin <ldv <at> altlinux.org> wrote:
> 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.

Thank you. Pushed, along with a few other changes.




This bug report was last modified 354 days ago.

Previous Next


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