This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH c/c++] use explicit locations for some warnings in c-pragma.c
- From: Marek Polacek <polacek at redhat dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 25 May 2015 21:56:50 +0200
- Subject: Re: [PATCH c/c++] use explicit locations for some warnings in c-pragma.c
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQAss9wY48rxjsVC_VHn5c2bC+ZKf4m6fvL-ZNVFLkmKEA at mail dot gmail dot com>
On Mon, May 25, 2015 at 06:06:01PM +0200, Manuel López-Ibáñez wrote:
> if (token != CPP_NAME)
> - GCC_BAD ("missing [error|warning|ignored] after %<#pragma GCC diagnostic%>");
> + {
> + warning_at (loc, OPT_Wpragmas,
> + "missing [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>");
Line too long.
> - GCC_BAD ("expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>");
> + {
> + warning_at (loc, OPT_Wpragmas,
> + "expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>");
Likewise.
Perhaps we should introduce GCC_BAD_LOC with a location_t argument and use it
here.
Marek