still need to disable variable tracking to silence unwanted warnings on ubuntu

This commit is contained in:
Axel Kohlmeyer 2020-05-12 18:09:05 -04:00
parent cec18b6aef
commit 60dfb6f77f
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 11 additions and 5 deletions

View File

@ -250,17 +250,23 @@ The typecast prevents compiler warnings about possible truncations.
// functions and avoid compiler warnings about variable tracking. // functions and avoid compiler warnings about variable tracking.
// Disable for broken -D_FORTIFY_SOURCE feature. // Disable for broken -D_FORTIFY_SOURCE feature.
#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) #if defined(__clang__)
#define _noopt
#elif defined(__clang__)
# define _noopt __attribute__((optnone)) # define _noopt __attribute__((optnone))
#elif defined(__INTEL_COMPILER) #elif defined(__INTEL_COMPILER)
# define _noopt # define _noopt
#elif defined(__GNUC__) #elif defined(__GNUC__)
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))
# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments"))) # if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0)
# define _noopt __attribute__((optimize("no-var-tracking-assignments")))
# else
# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments")))
# endif
# else # else
# define _noopt __attribute__((optimize("O0"))) # if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0)
# define _noopt
# else
# define _noopt __attribute__((optimize("O0")))
# endif
# endif # endif
#else #else
# define _noopt # define _noopt