* [COMMITTED] ada: Fix crash with -gnatdJ and -gnatf
@ 2024-05-14 8:24 Marc Poulhiès
0 siblings, 0 replies; only message in thread
From: Marc Poulhiès @ 2024-05-14 8:24 UTC (permalink / raw)
To: gcc-patches; +Cc: Ronan Desplanques
From: Ronan Desplanques <desplanques@adacore.com>
This patch fixes a crash when the compiler emits a warning about
an unchecked conversion and -gnatdJ is enabled.
gcc/ada/
* sem_ch13.adb (Validate_Unchecked_Conversions): Add node
parameters to Error_Msg calls.
Tested on x86_64-pc-linux-gnu, committed on master.
---
gcc/ada/sem_ch13.adb | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 0470ce10ac7..1ad5c4c0128 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -18401,7 +18401,8 @@ package body Sem_Ch13 is
Error_Msg_Uint_1 := Source_Siz;
Error_Msg_Name_2 := Chars (Target);
Error_Msg_Uint_2 := Target_Siz;
- Error_Msg ("\size of % is ^, size of % is ^?z?", Eloc);
+ Error_Msg
+ ("\size of % is ^, size of % is ^?z?", Eloc, Act_Unit);
Error_Msg_Uint_1 := UI_Abs (Source_Siz - Target_Siz);
@@ -18412,17 +18413,17 @@ package body Sem_Ch13 is
if Source_Siz > Target_Siz then
Error_Msg
("\?z?^ high order bits of source will "
- & "be ignored!", Eloc);
+ & "be ignored!", Eloc, Act_Unit);
elsif Is_Unsigned_Type (Source) then
Error_Msg
("\?z?source will be extended with ^ high order "
- & "zero bits!", Eloc);
+ & "zero bits!", Eloc, Act_Unit);
else
Error_Msg
("\?z?source will be extended with ^ high order "
- & "sign bits!", Eloc);
+ & "sign bits!", Eloc, Act_Unit);
end if;
elsif Source_Siz < Target_Siz then
--
2.43.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-14 8:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-14 8:24 [COMMITTED] ada: Fix crash with -gnatdJ and -gnatf Marc Poulhiès
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).