This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c-parser.c replace error() by error_at()
- From: Marek Polacek <polacek at redhat dot com>
- To: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 19 Feb 2014 14:31:54 +0100
- Subject: Re: c-parser.c replace error() by error_at()
- Authentication-results: sourceware.org; auth=none
- References: <CAJXstsDHNjRRuOuG2A=fS0TMzUPnLrJsdJ0=cpwEb+d554=H3g at mail dot gmail dot com>
On Wed, Feb 19, 2014 at 06:05:12PM +0530, Prathamesh Kulkarni wrote:
> Replace calls to error() by error_at().
>
> * c-parser.c (c_parser_declspecs): replace call to error () by error_at ()
"Replace", drop ()'s, full stop at the end.
> * c-parser.c (c_parser_parameter_declaration): Likewise
Full stop at the end.
> @@ -3608,7 +3608,7 @@ c_parser_parameter_declaration (c_parser
> c_parser_set_source_position_from_token (token);
> if (c_parser_next_tokens_start_typename (parser, cla_prefer_type))
> {
> - error ("unknown type name %qE", token->value);
> + error_at (token->location, "unknown type name %qE", token->value);
Only one space between , and ".
It'd be nice to add a testcase as well, e.g. something like this
void
fn1 (const foo x) /* { dg-error "..." } */
{
}
void
fn2 (int i; foo a; int i) /* { dg-error "..." } */
{
}
void
fn3 (char c, foo x, ...) /* { dg-error "..." } */
{
}
Marek