define _noopt macro with -D_FORTIFY_SOURCE to be empty to avoid false positives

This commit is contained in:
Axel Kohlmeyer 2020-05-10 14:06:56 -04:00
parent 987bff27d4
commit afd769314b
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 6 additions and 3 deletions

View File

@ -206,10 +206,13 @@ typedef int bigint;
#define _noalias
#endif
// declaration to turn off optimization for specific functions
// and avoid compiler warnings about variable tracking
// Declaration to turn off optimization for specific noncritical
// functions and avoid compiler warnings about variable tracking.
// Disable for broken -D_FORTIFY_SOURCE feature.
#if defined(__clang__)
#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0)
#define _noopt
#elif defined(__clang__)
# define _noopt __attribute__((optnone))
#elif defined(__INTEL_COMPILER)
# define _noopt