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++/53431] C++ preprocessor ignores #pragma GCC diagnostic


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

--- Comment #10 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
Created attachment 35688
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35688&action=edit
WIP patch

A WIP patch. I took a different approach: Move the handling of the pragma to
the preprocessor. 

It is a bit ugly, but the problem is that we cannot access diagnostic.h and
similar headers from the preprocessor. In my ideal world, we would have a
libdiagnostic.a that can be linked to the preprocessor and the FEs, and avoid
those callbacks (if someone wants to implement a different diagnostic output,
they can simply implement a basic libdiagnostic.a).

The main problem I didn't know how to solve is that, once processed, the
preprocessor removes the pragmas. Ideally, the pragmas should be evaluated when
lexing, independently of whether the file is preprocessed or not. Otherwise, it
will break things like ccache.

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