public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Improve fatal_expected_char() EOF reporting
@ 2006-11-28 20:52 Rask Ingemann Lambertsen
  2006-11-28 22:28 ` Mike Stump
  2007-08-10  8:52 ` PING " Rask Ingemann Lambertsen
  0 siblings, 2 replies; 6+ messages in thread
From: Rask Ingemann Lambertsen @ 2006-11-28 20:52 UTC (permalink / raw)
  To: gcc-patches

   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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-24  0:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-28 20:52 [PATCH] Improve fatal_expected_char() EOF reporting Rask Ingemann Lambertsen
2006-11-28 22:28 ` Mike Stump
2006-11-30 20:07   ` Rask Ingemann Lambertsen
2006-11-30 22:53     ` Mike Stump
2007-08-10  8:52 ` PING " Rask Ingemann Lambertsen
2007-08-24  0:44   ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).