This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/27777] Bad diagnostic emission when #error contains a trigraph
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jan 2007 02:14:24 -0000
- Subject: [Bug preprocessor/27777] Bad diagnostic emission when #error contains a trigraph
- References: <bug-27777-6809@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from tromey at gcc dot gnu dot org 2007-01-08 02:14 -------
I looked into this a little bit tonight.
The bug here is that the code for #error calls
cpp_output_line, which ends up calling
cpp_error_with_line when transforming the trigraph.
So, the trigraph warning is emitted before
cpp_output_line can emit its \n.
At first glance I don't see an elegant fix.
Perhaps we could change errors.c to keep a list of
errors to print, and then defer printing errors in
do_diagnostic. This should not be overly difficult,
since libiberty has vasprintf.
--
tromey at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27777