]> gcc.gnu.org Git - gcc.git/commit
c: more precise locations for some -Wpragmas diagnostics
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 4 Nov 2021 21:58:27 +0000 (17:58 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 9 Nov 2021 23:25:44 +0000 (18:25 -0500)
commit8722a17067f1590e82f49b3fd385647b762a45dc
tree21f0cace4088bbeca64d6acff45b8c5daa478e6d
parent96276f99352711475236ae5833a781fc55985f01
c: more precise locations for some -Wpragmas diagnostics

gcc/c-family/ChangeLog:
* c-pragma.c (GCC_BAD_AT): New macro.
(GCC_BAD2_AT): New macro.
(handle_pragma_pack): Use the location of the pertinent token when
issuing diagnostics about invalid constants/actions, and trailing
junk.
(handle_pragma_target): Likewise for non-string "GCC option".
(handle_pragma_message): Likewise for trailing junk.

gcc/testsuite/ChangeLog:
* gcc.dg/bad-pragma-locations.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/c-family/c-pragma.c
gcc/testsuite/gcc.dg/bad-pragma-locations.c [new file with mode: 0644]
This page took 0.072279 seconds and 6 git commands to generate.