This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/84127] pragmas to disable -Wexpansion-to-defined compiler warnings seems to be broken since 7.x


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I don't see what kind of change you are talking about, except that the
-Wexpansion-to-defined warning has been added in 7.x.

The reason why the GCC diagnostic ignore pragma works for this warning in C and
doesn't in C++ is that in C++ we preprocess/tokenize everything first and only
then start parsing it.  The pragmas are handled while parsing stuff, after all
the preprocessing and thus also preprocessor diagnostics is emitted.

To handle what you want would require that we handle GCC diagnostic pragmas
twice, once during preprocessing using preprocessor tokenization infrastructure
first and then once again after the preprocessing.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]