1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00

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.
This commit is contained in:
Roland Mc Grath
2012-05-08 19:44:57 +02:00
committed by Andreas Jaeger
parent 4b30f61a1e
commit 05c2c9618f
3 changed files with 16 additions and 6 deletions

View File

@ -325,14 +325,18 @@
# define __USE_REENTRANT 1
#endif
#if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
&& __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# if _FORTIFY_SOURCE > 1
#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)
# warning _FORTIFY_SOURCE requires GCC 4.1 or later
# elif _FORTIFY_SOURCE > 1
# define __USE_FORTIFY_LEVEL 2
# else
# define __USE_FORTIFY_LEVEL 1
# endif
#else
#endif
#ifndef __USE_FORTIFY_LEVEL
# define __USE_FORTIFY_LEVEL 0
#endif