gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: Patch for bug c++/17964 (cpp error locations for C++)

Subject: Re: Patch for bug c++/17964 cpp error locations for C++
From: "Joseph S. Myers"
Date: Fri, 4 Nov 2005 01:17:47 +0000 UTC
I've applied the following followup patch as obvious to fix a problem when 
va_list is an array type (pointed out by Andrew Pinski on IRC), having 
tested that the compiler builds OK with this patch on 
x86_64-unknown-linux-gnu.

Index: gcc/cp/error.c
===================================================================
--- gcc/cp/error.c      (revision 106465)
+++ gcc/cp/error.c      (working copy)
@@ -2334,7 +2334,7 @@
 
 void
 cp_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level,
-             const char *msg, va_list ap)
+             const char *msg, va_list *ap)
 {
   diagnostic_info diagnostic;
   diagnostic_t dlevel;
@@ -2356,7 +2356,7 @@
     default:
       gcc_unreachable ();
     }
-  diagnostic_set_info_translated (&diagnostic, msg, &ap,
+  diagnostic_set_info_translated (&diagnostic, msg, ap,
                                  input_location, dlevel);
   report_diagnostic (&diagnostic);
 }
Index: gcc/cp/cp-tree.h
===================================================================
--- gcc/cp/cp-tree.h    (revision 106465)
+++ gcc/cp/cp-tree.h    (working copy)
@@ -4438,7 +4438,7 @@
 #define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m)
 #endif
 extern void cp_cpp_error                       (cpp_reader *, int,
-                                                const char *, va_list)
+                                                const char *, va_list *)
      ATTRIBUTE_GCC_CXXDIAG(3,0);
 
 #endif /* ! GCC_CP_TREE_H */
Index: gcc/cp/ChangeLog
===================================================================
--- gcc/cp/ChangeLog    (revision 106465)
+++ gcc/cp/ChangeLog    (working copy)
@@ -1,3 +1,8 @@
+2005-11-04  Joseph S. Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+       * cp-tree.h (cp_cpp_error), error.c (cp_cpp_error): Take va_list*
+       parameter.
+
 2005-11-03  Joseph S. Myers  <joseph@xxxxxxxxxxxxxxxx>
 
        PR c++/17964
Index: libcpp/include/cpplib.h
===================================================================
--- libcpp/include/cpplib.h     (revision 106465)
+++ libcpp/include/cpplib.h     (working copy)
@@ -473,7 +473,7 @@
 
   /* Called to emit a diagnostic if client_diagnostic option is true.
      This callback receives the translated message.  */
-  void (*error) (cpp_reader *, int, const char *, va_list)
+  void (*error) (cpp_reader *, int, const char *, va_list *)
        ATTRIBUTE_PRINTF(3,0);
 };
 
Index: libcpp/ChangeLog
===================================================================
--- libcpp/ChangeLog    (revision 106465)
+++ libcpp/ChangeLog    (working copy)
@@ -1,3 +1,9 @@
+2005-11-04  Joseph S. Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+       * include/cpplib.h (struct cpp_callbacks): Make error take
+       va_list* parameter.
+       * errors.c (cpp_error): Update call to callback.
+
 2005-11-03  Andrew Pinski  <pinskia@xxxxxxxxxxxxxx>
 
        PR preprocessor/22042
Index: libcpp/errors.c
===================================================================
--- libcpp/errors.c     (revision 106465)
+++ libcpp/errors.c     (working copy)
@@ -141,7 +141,7 @@
   va_start (ap, msgid);
 
   if (CPP_OPTION (pfile, client_diagnostic))
-    pfile->cb.error (pfile, level, _(msgid), ap);
+    pfile->cb.error (pfile, level, _(msgid), &ap);
   else
     {
       if (CPP_OPTION (pfile, traditional))

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@xxxxxxxxxxxxxxxx (personal mail)
    joseph@xxxxxxxxxxxxxxxx (CodeSourcery mail)
    jsm28@xxxxxxxxxxx (Bugzilla assignments and CCs)

<Prev in Thread] Current Thread [Next in Thread>