This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Improve fatal_expected_char() EOF reporting
- From: Rask Ingemann Lambertsen <rask at sygehus dot dk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Nov 2006 21:43:55 +0100
- Subject: [PATCH] Improve fatal_expected_char() EOF reporting
Hi.
In read-rtl.c, fatal_expected_char() can output a binary EOF if
end-of-file is reached unexpectedly. One way that this can happen is if a
define_insn is at the end of the file and the terminating ')' is missing.
This patches changes fatal_expected_char() to print "EOF" instead.
Bootstrapped and regtested on i686-pc-linux-gnu with all default languages
with no new failures.
Much to my suprise, it "fixes" some failures:
=== libjava tests ===
Running target unix
FAIL: SyncTest execution - gij test
FAIL: SyncTest execution - gij test
=== libmudflap tests ===
Running target unix
FAIL: libmudflap.cth/pass39-frag.c (rerun 16) execution test
FAIL: libmudflap.cth/pass39-frag.c (rerun 16) output pattern test
I don't see how that can happen. The tests must be broken somehow.
ChangeLog:
2006-11-28 Rask Ingemann Lambertsen <rask@sygehus.dk>
* read-rtl.c (fatal_expected_char): Print EOF as text rather that
its binary representation.
Index: read-rtl.c
===================================================================
--- read-rtl.c (revision 119204)
+++ read-rtl.c (working copy)
@@ -219,8 +219,12 @@
static void
fatal_expected_char (FILE *infile, int expected_c, int actual_c)
{
- fatal_with_file_and_line (infile, "expected character `%c', found `%c'",
- expected_c, actual_c);
+ if (actual_c == EOF)
+ fatal_with_file_and_line (infile, "expected character `%c', found EOF",
+ expected_c);
+ else
+ fatal_with_file_and_line (infile, "expected character `%c', found `%c'",
+ expected_c, actual_c);
}
/* Implementations of the macro_group callbacks for modes. */
--
Rask Ingemann Lambertsen