* [Ada] Add insertion character for overlay modification warnings
@ 2022-05-30 8:32 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-30 8:32 UTC (permalink / raw)
To: gcc-patches; +Cc: Ghjuvan Lacambre
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
This enables tools that ingest GNAT's output to properly classify these
messages.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* freeze.adb (Warn_Overlay): Add 'o' insertion character.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Likewise.
* sem_util.adb (Note_Possible_Modifications): Likewise.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 2087 bytes --]
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -789,7 +789,7 @@ package body Freeze is
then
Error_Msg_Sloc := Sloc (Addr);
Error_Msg_NE
- ("??constant& may be modified via address clause#",
+ ("?o?constant& may be modified via address clause#",
Decl, O_Ent);
end if;
end;
@@ -10638,11 +10638,11 @@ package body Freeze is
if Present (Old) then
Error_Msg_Node_2 := Old;
Error_Msg_N
- ("default initialization of & may modify &??",
+ ("default initialization of & may modify &?o?",
Nam);
else
Error_Msg_N
- ("default initialization of & may modify overlaid storage??",
+ ("default initialization of & may modify overlaid storage?o?",
Nam);
end if;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -6705,7 +6705,7 @@ package body Sem_Ch13 is
and then not Overlays_Constant (U_Ent)
and then Address_Clause_Overlay_Warnings
then
- Error_Msg_N ("??constant overlays a variable", Expr);
+ Error_Msg_N ("?o?constant overlays a variable", Expr);
-- Imported variables can have an address clause, but then
-- the import is pretty meaningless except to suppress
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -25893,7 +25893,7 @@ package body Sem_Util is
Error_Msg_Sloc := Sloc (Addr);
Error_Msg_NE
- ("??constant& may be modified via address clause#",
+ ("?o?constant& may be modified via address clause#",
N, O_Ent);
end;
end if;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-30 8:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 8:32 [Ada] Add insertion character for overlay modification warnings Pierre-Marie de Rodat
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).