[PATCH] D92409: [AST][NFC] Silence GCC warning about multiline comments
Thomas Preud'homme via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 13 09:47:17 PST 2020
thopre added a comment.
In D92409#2450690 <https://reviews.llvm.org/D92409#2450690>, @rsmith wrote:
> In D92409#2450550 <https://reviews.llvm.org/D92409#2450550>, @thopre wrote:
>
>> In D92409#2426196 <https://reviews.llvm.org/D92409#2426196>, @thopre wrote:
>>
>>> Is there a way to disable it from the header? I've noticed this warning when compiling an application using libclang with g++. So I'm looking for a fix outside clang's build system which is not used in that case.
>>
>> Ping?
>
> `#pragma GCC diagnostic ignored` (https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html) can do it. Now, we can't reasonably guarantee that Clang headers won't cause arbitrary broken warnings to fire, so there's a judgment call here on the extent to which we should carry changes to support use of such warning flags (versus expecting the code including the header to disable the warning). In this case, it's probably worth it, though, because the warning in question is part of GCC's `-Wall`.
The documentation for that pragma says:
> Note that not all diagnostics are modifiable; at the moment only warnings (normally controlled by ‘-W…’) can be controlled, and not all of them.
Unfortunately -Wcomment seems to be one of them as the pragma has no effect on the warning, at least with GCC 7, I haven't tried other versions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92409/new/
https://reviews.llvm.org/D92409
More information about the cfe-commits
mailing list