[Win][Clang] Can't compile IGNORE_CLANG_WARNINGS_BEGIN While doing Bug 171618, following compilation error is reported. > [772/6184] Building CXX object Source\WTF\wtf\CMakeFiles\WTF.dir\StackBounds.cpp.obj > FAILED: Source/WTF/wtf/CMakeFiles/WTF.dir/StackBounds.cpp.obj > C:\tools\llvm\bin\clang-cl.exe (...) -c ..\..\Source\WTF\wtf\StackBounds.cpp > In file included from ..\..\Source\WTF\wtf\StackBounds.cpp:21: > In file included from ..\..\Source\WTF\config.h:31: > In file included from ..\..\Source\WTF\wtf/FastMalloc.h:26: > In file included from ..\..\Source\WTF\wtf/StdLibExtras.h:33: > ..\..\Source\WTF\wtf/Assertions.h(605,1): error: C++ requires a type specifier for all declarations > IGNORE_CLANG_WARNINGS_BEGIN("missing-noreturn") > ^ > ..\..\Source\WTF\wtf/Compiler.h(434,46): note: expanded from macro 'IGNORE_CLANG_WARNINGS_BEGIN' > #define IGNORE_CLANG_WARNINGS_BEGIN(warning) IGNORE_WARNINGS_BEGIN_IMPL(clang, warning) > ^ > In file included from ..\..\Source\WTF\wtf\StackBounds.cpp:21: > In file included from ..\..\Source\WTF\config.h:31: > In file included from ..\..\Source\WTF\wtf/FastMalloc.h:26: > In file included from ..\..\Source\WTF\wtf/StdLibExtras.h:33: > ..\..\Source\WTF\wtf/Assertions.h(605,1): error: use of undeclared identifier 'clang' > ..\..\Source\WTF\wtf/Compiler.h(434,73): note: expanded from macro 'IGNORE_CLANG_WARNINGS_BEGIN' > #define IGNORE_CLANG_WARNINGS_BEGIN(warning) IGNORE_WARNINGS_BEGIN_IMPL(clang, warning) > ^ > In file included from ..\..\Source\WTF\wtf\StackBounds.cpp:21: > In file included from ..\..\Source\WTF\config.h:31: > In file included from ..\..\Source\WTF\wtf/FastMalloc.h:26: > In file included from ..\..\Source\WTF\wtf/StdLibExtras.h:33: > ..\..\Source\WTF\wtf/Assertions.h(605,48): error: expected ';' after top level declarator > IGNORE_CLANG_WARNINGS_BEGIN("missing-noreturn") > ^ See Also: Bug 188996 – Add IGNORE_WARNING_.* macros
Created attachment 350094 [details] Patch
Comment on attachment 350094 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350094&action=review > Source/WTF/ChangeLog:16 > + * wtf/Compiler.h: Replaced "COMPILER(GCC_OR_CLANG)" with "COMPILER(GCC) || COMPILER(CLANG)" of IGNORE_WARNINGS_* macros. Will we need to do this for other uses of GCC_OR_CLANG?
Comment on attachment 350094 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=350094&action=review >> Source/WTF/ChangeLog:16 >> + * wtf/Compiler.h: Replaced "COMPILER(GCC_OR_CLANG)" with "COMPILER(GCC) || COMPILER(CLANG)" of IGNORE_WARNINGS_* macros. > > Will we need to do this for other uses of GCC_OR_CLANG? Just only this one because I want to enable GCC and Clang warning macros even for Clang for Windows.
R?
It's messed up if COMPILER(GCC_OR_CLANG) returns false when using Clang. I think we need to replace COMPILER(GCC_OR_CLANG) with something like COMPILER(GCC_COMPATIBLE).
(In reply to Michael Catanzaro from comment #5) > It's messed up if COMPILER(GCC_OR_CLANG) returns false when using Clang. > > I think we need to replace COMPILER(GCC_OR_CLANG) with something like > COMPILER(GCC_COMPATIBLE). It sounds good. I will do it.
Created attachment 350346 [details] Patch
LGTM. I see the CMake COMPILER_IS_GCC_OR_CLANG is already true for Clang, so that's good.
Comment on attachment 350346 [details] Patch Please wait one day before committing this is case anyone has other naming suggestions.
Created attachment 350728 [details] Patch to land Thank you for the review. * Rebased onto Tot.
Comment on attachment 350728 [details] Patch to land Clearing flags on attachment: 350728 Committed r236450: <https://trac.webkit.org/changeset/236450>
All reviewed patches have been landed. Closing bug.
<rdar://problem/44750032>