[PATCH] D118551: [ELF] De-template LinkerDriver::link. NFC

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 13:21:05 PST 2022


MaskRay added a comment.

In D118551#3288334 <https://reviews.llvm.org/D118551#3288334>, @mstorsjo wrote:

> In D118551#3288308 <https://reviews.llvm.org/D118551#3288308>, @MaskRay wrote:
>
>> In D118551#3288226 <https://reviews.llvm.org/D118551#3288226>, @mstorsjo wrote:
>>
>>> This causes a bunch of build warnings for me, like this:
>>>
>>>   ../tools/lld/ELF/InputSection.cpp:86:37: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro  
>>>      86 |     invokeELFT(parseCompressedHeader);
>>>         |                                     ^
>>
>> What's your compiler? It may be the `-pedantic` option.
>>
>> This is supported since C++20 but we are compiling in -std=c++14 mode now.
>>
>> For older clang, I used `#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"` to remove the diagnostic.
>
> This is with GCC 9.3 (Ubuntu 20.04 default compiler).

In GCC the diagnostic is controlled by -pedantic/-Wpedantic.
At least 11 correctly suppresses the warning in -stdc=c++2a mode.

Unfortunately, for older language modes, `#pragma GCC diagnostic ignored "-Wpedantic"` does not suppress the diagnostic (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90843).
We can either ignore it (GCC compiling llvm-project has many diagnostics anyway) or change `llvm/CMakeLists.txt` to default `LLVM_ENABLE_PEDANTIC` to off for GCC.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118551/new/

https://reviews.llvm.org/D118551



More information about the llvm-commits mailing list