Re: print quotes around )

2014-02-10 Thread Joseph S. Myers
On Sun, 9 Feb 2014, Prathamesh Kulkarni wrote:

> On Sun, Feb 9, 2014 at 8:31 PM, Prathamesh Kulkarni
>  wrote:
> > A trivial fix to print quotes around ) in libcpp/macro.c
> > OK for trunk ?
> Will not work for if pfile->cb.error callback does not recognize %< and %>
> (maybe clients other than c, c++ front-ends ?).
> So we cannot include %< and %> in the error message ?

Certainly not while the callback is declared ATTRIBUTE_FPTR_PRINTF, I'd 
have expected the bootstrap to fail with -Werror warnings  (Declaring 
the callback to allow GCC-internal formats might have corresponding 
requirements for particular types to be declared first, where the 
format-checking machinery knows how GCC-internal formats use GCC-internal 
typedefs; you'd need to check.)

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: print quotes around )

2014-02-09 Thread Prathamesh Kulkarni
On Sun, Feb 9, 2014 at 8:31 PM, Prathamesh Kulkarni
 wrote:
> A trivial fix to print quotes around ) in libcpp/macro.c
> OK for trunk ?
Will not work for if pfile->cb.error callback does not recognize %< and %>
(maybe clients other than c, c++ front-ends ?).
So we cannot include %< and %> in the error message ?
>
> * macro.c (parse_params): print quote around ) in call to cpp_error() in
> case CPP_EOF
>
> Index: libcpp/macro.c
> ===
> --- libcpp/macro.c(revision 207627)
> +++ libcpp/macro.c(working copy)
> @@ -2815,7 +2815,7 @@ parse_params (cpp_reader *pfile, cpp_mac
>/* Fall through.  */
>
>  case CPP_EOF:
> -  cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list");
> +  cpp_error (pfile, CPP_DL_ERROR, "missing %<)%> in macro parameter 
> list");
>return false;
>  }
>  }


print quotes around )

2014-02-09 Thread Prathamesh Kulkarni
A trivial fix to print quotes around ) in libcpp/macro.c
OK for trunk ?

* macro.c (parse_params): print quote around ) in call to cpp_error() in
case CPP_EOF

Index: libcpp/macro.c
===
--- libcpp/macro.c(revision 207627)
+++ libcpp/macro.c(working copy)
@@ -2815,7 +2815,7 @@ parse_params (cpp_reader *pfile, cpp_mac
   /* Fall through.  */

 case CPP_EOF:
-  cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list");
+  cpp_error (pfile, CPP_DL_ERROR, "missing %<)%> in macro parameter list");
   return false;
 }
 }