mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-27 05:00:15 +00:00
posix: Fix macro expansion producing 'defined' has undefined behavior
The NEED_CHECK_SPEC is defined as: #define NEED_CHECK_SPEC \ (!defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \ || !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \ || !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \ || !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG \ || !defined _POSIX_V7_ILP32_OFF32 || !defined _POSIX_V7_ILP32_OFFBIG \ || !defined _POSIX_V7_LP64_OFF64 || !defined _POSIX_V7_LPBIG_OFFBIG) Which is undefined behavior accordingly to C Standard (Preprocessing directives, p4). Checked on x86_64-linux-gnu.
This commit is contained in:
parent
6c4ee1aba1
commit
ddcf5a9170
@ -37,13 +37,17 @@
|
||||
#define NEED_SPEC_ARRAY 0
|
||||
#include <posix-conf-vars.h>
|
||||
|
||||
#define NEED_CHECK_SPEC \
|
||||
(!defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \
|
||||
#if !defined _XBS5_ILP32_OFF32 || !defined _XBS5_ILP32_OFFBIG \
|
||||
|| !defined _XBS5_LP64_OFF64 || !defined _XBS5_LPBIG_OFFBIG \
|
||||
|| !defined _POSIX_V6_ILP32_OFF32 || !defined _POSIX_V6_ILP32_OFFBIG \
|
||||
|| !defined _POSIX_V6_LP64_OFF64 || !defined _POSIX_V6_LPBIG_OFFBIG \
|
||||
|| !defined _POSIX_V7_ILP32_OFF32 || !defined _POSIX_V7_ILP32_OFFBIG \
|
||||
|| !defined _POSIX_V7_LP64_OFF64 || !defined _POSIX_V7_LPBIG_OFFBIG)
|
||||
|| !defined _POSIX_V7_LP64_OFF64 || !defined _POSIX_V7_LPBIG_OFFBIG
|
||||
# define NEED_CHECK_SPEC 1
|
||||
#else
|
||||
# define NEED_CHECK_SPEC 0
|
||||
#endif
|
||||
|
||||
#if NEED_CHECK_SPEC
|
||||
static long int __sysconf_check_spec (const char *spec);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user