This is the mail archive of the gcc-patches@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]

[patch, fortran] Backport revised error messages to 4.2


The attached patch backports my recent revision of the GFortran error message patches to 4.2, thereby fixing the bug with regards to nonconformance with GNU standards. (I'm submitting it for approval separately, since it's a combination of two that I committed to trunk.)

Regression tested on 4.2 on i686-pc-gnu-linux. I get one FAIL which I believe is unrelated: "FAIL: gfortran.dg/secnds.f -O1 execution test"; otherwise it passes.

Ok for 4.2?

- Brooks
Index: fortran/error.c
===================================================================
--- fortran/error.c	(revision 118484)
+++ fortran/error.c	(working copy)
@@ -134,7 +134,7 @@
 
   lb = loc->lb;
   f = lb->file;
-  error_printf ("In file %s:%d\n", f->filename,
+  error_printf ("%s:%d:\n", f->filename,
 #ifdef USE_MAPPED_LOCATION
 		LOCATION_LINE (lb->location)
 #else
@@ -380,7 +380,8 @@
   if (have_l1)
     show_loci (l1, l2);
   error_string (type);
-  error_char (' ');
+  if (*type)
+    error_char (' ');
 
   have_l1 = 0;
   format = format0;
Index: testsuite/lib/gfortran-dg.exp
===================================================================
--- testsuite/lib/gfortran-dg.exp	(revision 118484)
+++ testsuite/lib/gfortran-dg.exp	(working copy)
@@ -26,23 +26,23 @@
     set output_file [lindex $result 1]
 
     # gfortran error messages look like this:
-    #      In file [name]:[line]
+    #     [name]:[line]:
     #
     #        some code
     #              1
-    #     Error: Some error at (1) and (2)
+    #     Error: Some error at (1)
     # or
-    #      In file [name]:[line]
+    #     [name]:[line]:
     #
     #       some code
     #              1
-    #      In file [name]:[line2]
+    #     [name]:[line2]:
     #
     #       some other code
     #         2
     #     Error: Some error at (1) and (2)
     # or
-    #      In file [name]:[line]
+    #     [name]:[line]:
     #
     #       some code and some more code
     #              1       2
@@ -59,7 +59,7 @@
     # Note that these regexps only make sense in the combinations used below.
     # Note also that is imperative that we first deal with the form with
     # two loci.
-    set locus_regexp " In file (\[^\n\]*)\n\n\[^\n\]*\n\[^\n\]*\n"
+    set locus_regexp "(\[^\n\]*):\n\n\[^\n\]*\n\[^\n\]*\n"
     set diag_regexp "(\[^\n\]*)\n"
 
     set two_loci "$locus_regexp$locus_regexp$diag_regexp"

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