From: Pierre-Marie de Rodat <derodat@adacore.com>
To: gcc-patches@gcc.gnu.org
Cc: Ghjuvan Lacambre <lacambre@adacore.com>
Subject: [Ada] Fix record layout warnings not being tagged
Date: Thu, 2 Jun 2022 09:09:17 +0000 [thread overview]
Message-ID: <20220602090917.GA1011046@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 241 bytes --]
This allows tools ingesting GNAT's output to properly classify these
messages.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* gcc-interface/decl.cc (warn_on_field_placement): Add insertion
character '.q' to warning string.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1477 bytes --]
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -7770,20 +7770,20 @@ warn_on_field_placement (tree gnu_field, Node_Id gnat_component_list,
const char *msg1
= in_variant
- ? "??variant layout may cause performance issues"
- : "??record layout may cause performance issues";
+ ? "?.q?variant layout may cause performance issues"
+ : "?.q?record layout may cause performance issues";
const char *msg2
= Ekind (gnat_field) == E_Discriminant
- ? "??discriminant & whose length is not multiple of a byte"
+ ? "?.q?discriminant & whose length is not multiple of a byte"
: field_has_self_size (gnu_field)
- ? "??component & whose length depends on a discriminant"
+ ? "?.q?component & whose length depends on a discriminant"
: field_has_variable_size (gnu_field)
- ? "??component & whose length is not fixed"
- : "??component & whose length is not multiple of a byte";
+ ? "?.q?component & whose length is not fixed"
+ : "?.q?component & whose length is not multiple of a byte";
const char *msg3
= do_reorder
- ? "??comes too early and was moved down"
- : "??comes too early and ought to be moved down";
+ ? "?.q?comes too early and was moved down"
+ : "?.q?comes too early and ought to be moved down";
post_error (msg1, gnat_field);
post_error_ne (msg2, gnat_field, gnat_field);
reply other threads:[~2022-06-02 9: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=20220602090917.GA1011046@adacore.com \
--to=derodat@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=lacambre@adacore.com \
/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: link
Be 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).