aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2020-05-12 22:41:09 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2020-05-12 22:42:17 +0200
commit11dd3be56b83d11465ae5d6ecd0d8096531678e5 (patch)
tree92afa92a161826bfa118d94924b7ad9ee23fcc1d
parent2a0225e47868fbfceaecaa5e2de96c1c5a2251ea (diff)
downloadgcc-11dd3be56b83d11465ae5d6ecd0d8096531678e5.zip
gcc-11dd3be56b83d11465ae5d6ecd0d8096531678e5.tar.gz
gcc-11dd3be56b83d11465ae5d6ecd0d8096531678e5.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/ChangeLog4
-rw-r--r--gcc/c-family/c-ada-spec.c9
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);