aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2024-11-11 11:01:12 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-11-26 10:49:35 +0100
commit9fb54f47d0f5c149c94e86def16e538460ce3636 (patch)
treec5cd0f4bc436e16eab847e1f5d0ccf8f939ef5bd /gcc
parent8d0bb808f632eea52548df59e36c1b479c64c45b (diff)
downloadgcc-9fb54f47d0f5c149c94e86def16e538460ce3636.zip
gcc-9fb54f47d0f5c149c94e86def16e538460ce3636.tar.gz
gcc-9fb54f47d0f5c149c94e86def16e538460ce3636.tar.bz2
ada: Remove Warn_Runtime_Raise attribute from Error_Msg_Object
The goal of this attribute is to raise a warning to an error when the -gnatwE flag is used. This is similar to the existing warnings as error behavior under the Warn_Err flag so it can be merged. gcc/ada/ChangeLog: * errout.adb: Set Warn_Err as true if Is_Runtime_Error was set in the error message. * erroutc.adb: Remove instances of Warn_Runtime_Raise. * erroutc.ads: Likewise. * errutil.adb: Likewise.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/errout.adb31
-rw-r--r--gcc/ada/erroutc.adb1
-rw-r--r--gcc/ada/erroutc.ads4
-rw-r--r--gcc/ada/errutil.adb1
4 files changed, 4 insertions, 33 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 644fd1f..8858df1 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -1246,7 +1246,6 @@ package body Errout is
Compile_Time_Pragma => Is_Compile_Time_Msg,
Warn_Err => False, -- reset below
Warn_Chr => Warning_Msg_Char,
- Warn_Runtime_Raise => Is_Runtime_Raise,
Uncond => Is_Unconditional_Msg,
Msg_Cont => Continuation,
Deleted => False,
@@ -1258,20 +1257,14 @@ package body Errout is
Warn_Err :=
Error_Msg_Kind in Warning | Style
and then (Warning_Treated_As_Error (Msg_Buffer (1 .. Msglen))
- or else Warning_Treated_As_Error
- (Get_Warning_Tag (Cur_Msg)));
+ or else Warning_Treated_As_Error (Get_Warning_Tag (Cur_Msg))
+ or else Is_Runtime_Raise);
-- Propagate Warn_Err to this message and preceding continuations.
- -- Likewise, propagate Error_Msg_Kind and Is_Runtime_Raise, because the
- -- current continued message could have been escalated from warning to
- -- error.
for J in reverse 1 .. Errors.Last loop
Errors.Table (J).Warn_Err := Warn_Err;
- Errors.Table (J).Kind := Error_Msg_Kind;
- Errors.Table (J).Warn_Runtime_Raise := Is_Runtime_Raise;
-
exit when not Errors.Table (J).Msg_Cont;
end loop;
@@ -3587,28 +3580,13 @@ package body Errout is
-- not remove style messages here. They are warning messages
-- but not ones we want removed in this context.
- and then (Errors.Table (E).Kind = Warning
- or else
- Errors.Table (E).Warn_Runtime_Raise)
+ and then Errors.Table (E).Kind = Warning
-- Don't remove unconditional messages
and then not Errors.Table (E).Uncond
then
- if Errors.Table (E).Kind = Warning then
- Warnings_Detected := Warnings_Detected - 1;
- end if;
-
- -- When warning about a runtime exception has been escalated
- -- into error, the starting message has increased the total
- -- errors counter, so here we decrease this counter.
-
- if Errors.Table (E).Warn_Runtime_Raise
- and then not Errors.Table (E).Msg_Cont
- and then Warning_Mode = Treat_Run_Time_Warnings_As_Errors
- then
- Total_Errors_Detected := Total_Errors_Detected - 1;
- end if;
+ Warnings_Detected := Warnings_Detected - 1;
return True;
@@ -4361,7 +4339,6 @@ package body Errout is
if Error_Msg_Kind = Warning
and then Warning_Mode = Treat_Run_Time_Warnings_As_Errors
then
- Error_Msg_Kind := Non_Serious_Error;
Is_Runtime_Raise := True;
end if;
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index c572054..9d22996 100644
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -340,7 +340,6 @@ package body Erroutc is
w (" Col = ", Int (E.Col));
w (" Kind = ", E.Kind'Img);
w (" Warn_Err = ", E.Warn_Err);
- w (" Warn_Runtime_Raise = ", E.Warn_Runtime_Raise);
w (" Warn_Chr = '" & E.Warn_Chr & ''');
w (" Uncond = ", E.Uncond);
w (" Msg_Cont = ", E.Msg_Cont);
diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads
index 9a70cfa..76cd020 100644
--- a/gcc/ada/erroutc.ads
+++ b/gcc/ada/erroutc.ads
@@ -228,10 +228,6 @@ package Erroutc is
-- True if this is a warning message which is to be treated as an error
-- as a result of a match with a Warning_As_Error pragma.
- Warn_Runtime_Raise : Boolean;
- -- True if this a warning about a constraint error that will be raised
- -- at runtime.
-
Warn_Chr : String (1 .. 2);
-- See Warning_Msg_Char
diff --git a/gcc/ada/errutil.adb b/gcc/ada/errutil.adb
index 62cd867..1094e8a 100644
--- a/gcc/ada/errutil.adb
+++ b/gcc/ada/errutil.adb
@@ -211,7 +211,6 @@ package body Errutil is
Col => Get_Column_Number (Sptr),
Compile_Time_Pragma => Is_Compile_Time_Msg,
Warn_Err => Warning_Mode = Treat_As_Error,
- Warn_Runtime_Raise => Is_Runtime_Raise,
Warn_Chr => Warning_Msg_Char,
Uncond => Is_Unconditional_Msg,
Msg_Cont => Continuation,