[Bug c/52116] pragma GCC diagnostic only acts on some lines

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 9 17:40:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52116

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Ben Longbons from comment #0)
> Case 1. Wrapping a warning location in _Pragma("GCC diagnostic ignored
> \"-Wshadow\"") does not work (sometimes). This precludes error suppression
> during macro expansion. Oddly, it suppresses as expected (mostly) if both
> are on the same line. (Although it behaves oddly if one is "warning" and one
> is "ignored")

This seems fixed in GCC 7.0, possibly earlier.


More information about the Gcc-bugs mailing list