Skip to content

Don't #define USE_ASM (defined(USE_X86_ASM) || ... )

Created by: aaronp24

This produces a warning when built with clang:

 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:46:26: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
 #if defined(__GNUC__) && USE_ASM
                          ^
 ../../home/aaron/git/libglvnd/src/util/glvnd_genentry.c:40:18: note: expanded from macro 'USE_ASM'
 #define USE_ASM (defined(USE_X86_ASM) ||    \

Instead, use the defined(...) conditions to conditionally define USE_ASM to 1 or 0 explicitly.

Merge request reports

Loading