toplev.c (report_error_function): Reorder file stack and function name printing.
authorNathan Sidwell <nathan@acm.org>
Mon, 26 Apr 1999 00:07:58 +0000 (00:07 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 26 Apr 1999 00:07:58 +0000 (18:07 -0600)
        * toplev.c (report_error_function): Reorder file stack and
        function name printing.  Ignore FILE parameter.

From-SVN: r26631

gcc/ChangeLog
gcc/toplev.c

index 75802c5cba8e7ceb3482362b11178a62ed448d5e..349ca8116aeda7e3da7bf210ff394ce657aafdd9 100644 (file)
@@ -1,3 +1,8 @@
+Mon Apr 26 01:02:34 1999  Nathan Sidwell  <nathan@acm.org>
+
+       * toplev.c (report_error_function): Reorder file stack and
+       function name printing.  Ignore FILE parameter.
+
 Mon Apr 26 00:58:54 1999  Jerry Quinn <jquinn@nortelnetworks.com>
 
        * pa/pa-hpux.h, pa/pa-hpux10.h, pa/pa-hpux9.h, pa/pa-osf.h, pa.h,
index f5e534cb2fc61416abe7e16cf69e0aa175ab3927..58fafc1db299ee58df98439ef5219456bbe98a2e 100644 (file)
@@ -1544,11 +1544,12 @@ void (*print_error_function) PROTO((const char *)) =
   default_print_error_function;
 
 /* Prints out, if necessary, the name of the current function
-  that caused an error.  Called from all error and warning functions.  */
+  that caused an error.  Called from all error and warning functions.
+  We ignore the FILE parameter, as it cannot be relied upon.  */
 
 void
 report_error_function (file)
-  const char *file;
+  const char *file ATTRIBUTE_UNUSED;
 {
   struct file_stack *p;
 
@@ -1558,11 +1559,8 @@ report_error_function (file)
       need_error_newline = 0;
     }
 
-  (*print_error_function) (file);
-
   if (input_file_stack && input_file_stack->next != 0
-      && input_file_stack_tick != last_error_tick
-      && file == input_filename)
+      && input_file_stack_tick != last_error_tick)
     {
       for (p = input_file_stack->next; p; p = p->next)
        notice ((p == input_file_stack->next
@@ -1572,6 +1570,8 @@ report_error_function (file)
       fprintf (stderr, ":\n");
       last_error_tick = input_file_stack_tick;
     }
+
+  (*print_error_function) (input_filename);
 }
 \f
 /* Print a message.  */