diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2020-05-12 22:41:09 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:03:09 -0300 |
commit | 02320966f6ae5dce15a82905a21a4abb5c14947e (patch) | |
tree | a083996d16676d3e4c0ac4beba4e3a5216307005 | |
parent | 6f38c1da69102135cb47eeb741e15ef481dab61c (diff) | |
download | gcc-02320966f6ae5dce15a82905a21a4abb5c14947e.zip gcc-02320966f6ae5dce15a82905a21a4abb5c14947e.tar.gz gcc-02320966f6ae5dce15a82905a21a4abb5c14947e.tar.bz2 |
Suppress warning for Interfaces.C with -fdump-ada-spec
The C/C++ bindings generated by means of -fdump-ada-spec always contain
with and use clauses for Interfaces.C, but they can be unused in some
cases so make sure to avoid warning about that.
* c-ada-spec.c (dump_ads): Output pragma Warnings ("U"); on entry.
-rw-r--r-- | gcc/c-family/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c-family/c-ada-spec.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 0550e53..0be10ad 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2020-05-12 Eric Botcazou <ebotcazou@adacore.com> + + * c-ada-spec.c (dump_ads): Output pragma Warnings ("U"); on entry. + 2020-05-08 Nathan Sidwell <nathan@acm.org> Reimplement directives only processing. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 6d9192f..c75b173 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -3412,9 +3412,12 @@ dump_ads (const char *source_file, cpp_check = check; dump_ada_nodes (&pp, source_file); - /* We require Ada 2012 syntax, so generate corresponding pragma. - Also, disable style checks since this file is auto-generated. */ - fprintf (f, "pragma Ada_2012;\npragma Style_Checks (Off);\n\n"); + /* We require Ada 2012 syntax, so generate corresponding pragma. */ + fputs ("pragma Ada_2012;\n", f); + + /* Disable style checks and warnings on unused entities since this file + is auto-generated and always has a with clause for Interfaces.C. */ + fputs ("pragma Style_Checks (Off);\npragma Warnings (\"U\");\n\n", f); /* Dump withs. */ dump_ada_withs (f); |