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

* Re: [PATCH] Improve fatal_expected_char() EOF reporting
  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
  2007-08-10  8:52 ` PING " Rask Ingemann Lambertsen
  1 sibling, 1 reply; 6+ messages in thread
From: Mike Stump @ 2006-11-28 22:28 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches

On Nov 28, 2006, at 12:43 PM, Rask Ingemann Lambertsen wrote:
> This patches changes fatal_expected_char() to print "EOF" instead.

Looks good to me.  Looks trivial and obvious as well.

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

* Re: [PATCH] Improve fatal_expected_char() EOF reporting
  2006-11-28 22:28 ` Mike Stump
@ 2006-11-30 20:07   ` Rask Ingemann Lambertsen
  2006-11-30 22:53     ` Mike Stump
  0 siblings, 1 reply; 6+ messages in thread
From: Rask Ingemann Lambertsen @ 2006-11-30 20:07 UTC (permalink / raw)
  To: Mike Stump; +Cc: gcc-patches

On Tue, Nov 28, 2006 at 02:20:11PM -0800, Mike Stump wrote:
> On Nov 28, 2006, at 12:43 PM, Rask Ingemann Lambertsen wrote:
> >This patches changes fatal_expected_char() to print "EOF" instead.
> 
> Looks good to me.  Looks trivial and obvious as well.

   I don't have write access. Please commit it for me. Thanks.

-- 
Rask Ingemann Lambertsen

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

* Re: [PATCH] Improve fatal_expected_char() EOF reporting
  2006-11-30 20:07   ` Rask Ingemann Lambertsen
@ 2006-11-30 22:53     ` Mike Stump
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Stump @ 2006-11-30 22:53 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches

On Nov 30, 2006, at 11:43 AM, Rask Ingemann Lambertsen wrote:
> On Tue, Nov 28, 2006 at 02:20:11PM -0800, Mike Stump wrote:
>> On Nov 28, 2006, at 12:43 PM, Rask Ingemann Lambertsen wrote:
>>> This patches changes fatal_expected_char() to print "EOF" instead.
>>
>> Looks good to me.  Looks trivial and obvious as well.
>
>    I don't have write access. Please commit it for me. Thanks.

I've used up my all my spare I think this is obvious coins for the  
year.  :-(

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

* PING [PATCH] Improve fatal_expected_char() EOF reporting
  2006-11-28 20:52 [PATCH] Improve fatal_expected_char() EOF reporting Rask Ingemann Lambertsen
  2006-11-28 22:28 ` Mike Stump
@ 2007-08-10  8:52 ` Rask Ingemann Lambertsen
  2007-08-24  0:44   ` Ian Lance Taylor
  1 sibling, 1 reply; 6+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-08-10  8:52 UTC (permalink / raw)
  To: gcc-patches

On Tue, Nov 28, 2006 at 09:43:54PM +0100, Rask Ingemann Lambertsen wrote:
>    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.
[snip]
> 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

* Re: PING [PATCH] Improve fatal_expected_char() EOF reporting
  2007-08-10  8:52 ` PING " Rask Ingemann Lambertsen
@ 2007-08-24  0:44   ` Ian Lance Taylor
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Lance Taylor @ 2007-08-24  0:44 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches

Rask Ingemann Lambertsen <rask@sygehus.dk> writes:

> 2006-11-28  Rask Ingemann Lambertsen  <rask@sygehus.dk>
> 
> 	* read-rtl.c (fatal_expected_char): Print EOF as text rather that
> 	its binary representation.

This is OK.

Thanks.

Ian

^ 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).