public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-667] [Ada] Do not give warnings for compiler-generated entities by default Date: Thu, 19 May 2022 14:09:07 +0000 (GMT) [thread overview] Message-ID: <20220519140907.6EB7A383D80D@sourceware.org> (raw) https://gcc.gnu.org/g:e4c84b82c5f903de6911157281a837481bca780e commit r13-667-ge4c84b82c5f903de6911157281a837481bca780e Author: Eric Botcazou <ebotcazou@adacore.com> Date: Wed Mar 23 14:46:28 2022 +0100 [Ada] Do not give warnings for compiler-generated entities by default The rationale is that these entities are almost always the result of expansion activities in the front-end, over which the user has very limited control. These warnings can be restored by means of -gnatD. gcc/ada/ * gcc-interface/utils.cc (gnat_pushdecl): Also set TREE_NO_WARNING on the decl if Comes_From_Source is false for the associated node. Diff: --- gcc/ada/gcc-interface/utils.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/ada/gcc-interface/utils.cc b/gcc/ada/gcc-interface/utils.cc index d747c639a8f..c583acaf967 100644 --- a/gcc/ada/gcc-interface/utils.cc +++ b/gcc/ada/gcc-interface/utils.cc @@ -852,8 +852,11 @@ gnat_pushdecl (tree decl, Node_Id gnat_node) if (!deferred_decl_context) DECL_CONTEXT (decl) = context; - suppress_warning (decl, all_warnings, - No (gnat_node) || Warnings_Off (gnat_node)); + /* Disable warnings for compiler-generated entities or explicit request. */ + if (No (gnat_node) + || !Comes_From_Source (gnat_node) + || Warnings_Off (gnat_node)) + suppress_warning (decl); /* Set the location of DECL and emit a declaration for it. */ if (Present (gnat_node) && !renaming_from_instantiation_p (gnat_node))
reply other threads:[~2022-05-19 14:09 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220519140907.6EB7A383D80D@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).