From c4914de6185a913d2dbb152a15b0c43b9d70106c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= Date: Fri, 18 Sep 2015 19:36:19 +0000 Subject: Use explicit locations for some warnings in c-pragma.c. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc/cp/ChangeLog: 2015-09-18 Manuel López-Ibáñez * parser.c (pragma_lex): Add loc argument. Rearrange the code to make it more similar to the C version. gcc/c-family/ChangeLog: 2015-09-18 Manuel López-Ibáñez * c-pragma.c (handle_pragma_diagnostic): Use explicit location when warning. * c-pragma.h (pragma_lex): Add optional loc argument. gcc/c/ChangeLog: 2015-09-18 Manuel López-Ibáñez * c-parser.c (pragma_lex): Add loc argument. gcc/testsuite/ChangeLog: 2015-09-18 Manuel López-Ibáñez * gcc.dg/pragma-diag-5.c: New test. From-SVN: r227923 --- gcc/c/ChangeLog | 4 ++++ gcc/c/c-parser.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 27659e2..aa6d715 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,7 @@ +2015-09-18 Manuel López-Ibáñez + + * c-parser.c (pragma_lex): Add loc argument. + 2015-09-15 Marek Polacek PR c/67580 diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index d5de102..2fab3f0 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -9846,12 +9846,15 @@ c_parser_pragma (c_parser *parser, enum pragma_context context) /* The interface the pragma parsers have to the lexer. */ enum cpp_ttype -pragma_lex (tree *value) +pragma_lex (tree *value, location_t *loc) { c_token *tok = c_parser_peek_token (the_parser); enum cpp_ttype ret = tok->type; *value = tok->value; + if (loc) + *loc = tok->location; + if (ret == CPP_PRAGMA_EOL || ret == CPP_EOF) ret = CPP_EOF; else -- cgit v1.1