This happens for all the expansions of: - #if ENABLE(FOO) - #if PLATFORM(FOO) - #if CPU(FOO) - #if USE(FOO) - #if HAVE(FOO) - ... For example: ../../Source/WTF/wtf/Platform.h:807:1: warning: this use of "defined" may not be portable [-Wexpansion-to-defined] #if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS) ^~~~~~~~~~~~~ It seems that the -Wexpansion-to-defined existed before in GCC, but the warning is now enabled by default in version 7.1.x of the compiler. WebKit source code makes extensive use of this kind of expansions, so probably it'd be better to silence these warnings.
Created attachment 311307 [details] Patch
I know you already have a patch here and normally I'd favor the bug with the patch, but there's good discussion in bug #167643 so please reattach it there. My concern is that these macros are all undefined behavior, so we should consider eliminating them. *** This bug has been marked as a duplicate of bug 167643 ***
Comment on attachment 311307 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=311307&action=review > Source/cmake/OptionsCommon.cmake:78 > + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.1.0") > + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined") > + endif () No need to check compiler version, just enable it unconditionally. Look for wherever our other warning flags are used; we probably don't need to add a new line, just add it to wherever the other ones are.