OSDN Git Service

Definition of these two macros are corrected by adding matchine right paren.
[pf3gnuchains/gcc-fork.git] / gcc / diagnostic.c
index 3d64b87..b495d64 100644 (file)
@@ -1,5 +1,6 @@
 /* Language-independent diagnostic subroutines for the GNU Compiler Collection
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
 
 This file is part of GCC.
@@ -56,8 +57,6 @@ static void diagnostic_action_after_output (diagnostic_context *,
                                            diagnostic_info *);
 static void real_abort (void) ATTRIBUTE_NORETURN;
 
-extern int rtl_dump_and_exit;
-
 /* A diagnostic_context surrogate for stderr.  */
 static diagnostic_context global_diagnostic_context;
 diagnostic_context *global_dc = &global_diagnostic_context;
@@ -130,10 +129,17 @@ text_specifies_location (text_info *text, location_t *locus)
     ;
 
   /* Extract the location information if any.  */
-  if (*p == '%' && *++p == 'H')
+  if (p[0] == '%' && p[1] == 'H')
     {
       *locus = *va_arg (*text->args_ptr, location_t *);
-      text->format_spec = p + 1;
+      text->format_spec = p + 2;
+      return true;
+    }
+  else if (p[0] == '%' && p[1] == 'J')
+    {
+      tree t = va_arg (*text->args_ptr, tree);
+      *locus = DECL_SOURCE_LOCATION (t);
+      text->format_spec = p + 2;
       return true;
     }
 
@@ -287,7 +293,7 @@ void
 diagnostic_report_current_function (diagnostic_context *context)
 {
   diagnostic_report_current_module (context);
-  (*lang_hooks.print_error_function) (context, input_filename);
+  lang_hooks.print_error_function (context, input_filename);
 }
 
 void