From: GNU Libc Maintainers Date: Wed, 31 Jan 2024 20:45:37 +0000 (+0100) Subject: local-revert-bz13979 X-Git-Tag: archive/raspbian/2.37-15_deb13u1+rpi1^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=83097553d0949cbc5e403a9909eff64b8d6af88e;p=glibc.git local-revert-bz13979 Partially revert: Partially revert: From: Roland Mc Grath Date: Tue, 8 May 2012 17:44:57 +0000 (+0200) Subject: Warn if user requests __FORTIFY_SOURCE but it is disabled X-Git-Tag: glibc-2.16-tps~448 X-Git-Url: http://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=05c2c9618f583ea4acd69b3fe5ae2a2922dd2ddc Warn if user requests __FORTIFY_SOURCE but it is disabled [BZ #13979] * include/features.h: Warn if user requests __FORTIFY_SOURCE checking but the checks are disabled for any reason. Gbp-Pq: Topic any Gbp-Pq: Name local-revert-bz13979.diff --- diff --git a/include/features.h b/include/features.h index 26534f2b5..91fa132f1 100644 --- a/include/features.h +++ b/include/features.h @@ -408,10 +408,9 @@ # define __USE_GNU 1 #endif -#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 -# if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 -# warning _FORTIFY_SOURCE requires compiling with optimization (-O) -# elif !__GNUC_PREREQ (4, 1) +#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ + && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 +# if !__GNUC_PREREQ (4, 1) # warning _FORTIFY_SOURCE requires GCC 4.1 or later # elif _FORTIFY_SOURCE > 2 && (__glibc_clang_prereq (9, 0) \ || __GNUC_PREREQ (12, 0))