[Webkit-unassigned] [Bug 188996] Add IGNORE_WARNING_.* macros

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 29 07:55:47 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=188996

--- Comment #22 from Michael Catanzaro <mcatanzaro at igalia.com> ---
(In reply to Guillaume Emont from comment #21)
>  - As Michael was pointing out, gcc warns if you try to ignore a warning it
> does not know about, so at least some of the clang only warnings need to
> remain that way.

I think we can control this behavior using -Wno-pragmas and -Wno-unknown-pragmas:

       -Wunknown-pragmas
           Warn when a "#pragma" directive is encountered that is not
           understood by GCC.  If this command-line option is used, warnings
           are even issued for unknown pragmas in system header files.  This
           is not the case if the warnings are only enabled by the -Wall
           command-line option.

       -Wno-pragmas
           Do not warn about misuses of pragmas, such as incorrect parameters,
           invalid syntax, or conflicts between pragmas.  See also
           -Wunknown-pragmas.

I suggest we do use -Wno-unknown-pragmas, because it's annoying to see GCC complain every time #pragma clang is used. It's obvious that when #pragma clang is used, the pragma is intended to be ignored by GCC. It's not helpful for that to trigger warnings each time. If the GCC developers think -Wunknown-pragmas is useful, they should make it only warn when it sees unknown pragmas after #pragma GCC and not otherwise. (I'll remind developers that #pragma GCC should be used whenever a warning is not Clang-specific.)

The value of -Wno-pragmas is less-clear to me, but it would allow us to get the behavior requested by Darin and Alex to have just one macro not specific to each compiler, presuming Visual Studio does not have similar warnings or they can be turned off.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180829/d05bd482/attachment-0001.html>


More information about the webkit-unassigned mailing list