===================================================================
@@ -320,10 +320,16 @@
-- compilation. Initialized for -gnatVa use, see comment above. This
-- count includes the count of style and info messages.
- Info_Messages : Nat := 0;
- -- Number of info messages generated. Info messages are neved treated as
- -- errors (whether from use of the pragma, or the compiler switch -gnatwe).
+ Warning_Info_Messages : Nat := 0;
+ -- Number of info messages generated as warnings. Info messages are never
+ -- treated as errors (whether from use of the pragma, or the compiler
+ -- switch -gnatwe).
+ Report_Info_Messages : Nat := 0;
+ -- Number of info messages generated as reports. Info messages are never
+ -- treated as errors (whether from use of the pragma, or the compiler
+ -- switch -gnatwe). Used under Spark_Mode to report proved checks.
+
Check_Messages : Nat := 0;
-- Number of check messages generated. Check messages are neither warnings
-- nor errors.
===================================================================
@@ -277,7 +277,7 @@
Warnings_Detected := Warnings_Detected - 1;
if M.Info then
- Info_Messages := Info_Messages - 1;
+ Warning_Info_Messages := Warning_Info_Messages - 1;
end if;
if M.Warn_Err then
@@ -1186,12 +1186,14 @@
-- Bump appropriate statistics counts
if Errors.Table (Cur_Msg).Info then
- Info_Messages := Info_Messages + 1;
-- Could be (usually is) both "info" and "warning"
if Errors.Table (Cur_Msg).Warn then
+ Warning_Info_Messages := Warning_Info_Messages + 1;
Warnings_Detected := Warnings_Detected + 1;
+ else
+ Report_Info_Messages := Report_Info_Messages + 1;
end if;
elsif Errors.Table (Cur_Msg).Warn
@@ -1420,7 +1422,7 @@
Warnings_Detected := Warnings_Detected - 1;
if Errors.Table (E).Info then
- Info_Messages := Info_Messages - 1;
+ Warning_Info_Messages := Warning_Info_Messages - 1;
end if;
if Errors.Table (E).Warn_Err then
@@ -1785,12 +1787,12 @@
Write_Str (" errors");
end if;
- if Warnings_Detected - Info_Messages /= 0 then
+ if Warnings_Detected - Warning_Info_Messages /= 0 then
Write_Str (", ");
Write_Int (Warnings_Detected);
Write_Str (" warning");
- if Warnings_Detected - Info_Messages /= 1 then
+ if Warnings_Detected - Warning_Info_Messages /= 1 then
Write_Char ('s');
end if;
@@ -1810,12 +1812,12 @@
end if;
end if;
- if Info_Messages /= 0 then
+ if Warning_Info_Messages + Report_Info_Messages /= 0 then
Write_Str (", ");
- Write_Int (Info_Messages);
+ Write_Int (Warning_Info_Messages + Report_Info_Messages);
Write_Str (" info message");
- if Info_Messages > 1 then
+ if Warning_Info_Messages + Report_Info_Messages > 1 then
Write_Char ('s');
end if;
end if;
@@ -2119,13 +2121,13 @@
Write_Max_Errors;
- -- Even though info messages are a subclass of warnings, they must not
- -- be treated as errors when -gnatwe is in effect.
+ -- Even though Warning_Info_Messages are a subclass of warnings, they
+ -- must not be treated as errors when -gnatwe is in effect.
if Warning_Mode = Treat_As_Error then
Total_Errors_Detected :=
- Total_Errors_Detected + Warnings_Detected - Info_Messages;
- Warnings_Detected := Info_Messages;
+ Total_Errors_Detected + Warnings_Detected - Warning_Info_Messages;
+ Warnings_Detected := Warning_Info_Messages;
end if;
end Output_Messages;
@@ -2299,7 +2301,7 @@
Warnings_Detected := Warnings_Detected - 1;
if Errors.Table (E).Info then
- Info_Messages := Info_Messages - 1;
+ Warning_Info_Messages := Warning_Info_Messages - 1;
end if;
return True;
@@ -2400,7 +2402,7 @@
begin
Warnings_Treated_As_Errors := 0;
Warnings_Detected := 0;
- Info_Messages := 0;
+ Warning_Info_Messages := 0;
Warnings_As_Errors_Count := 0;
end Reset_Warnings;
===================================================================
@@ -140,10 +140,12 @@
-- Adjust error message count
if Errors.Table (D).Info then
- Info_Messages := Info_Messages - 1;
if Errors.Table (D).Warn then
+ Warning_Info_Messages := Warning_Info_Messages - 1;
Warnings_Detected := Warnings_Detected - 1;
+ else
+ Report_Info_Messages := Report_Info_Messages - 1;
end if;
elsif Errors.Table (D).Warn or else Errors.Table (D).Style then
@@ -244,7 +246,7 @@
begin
return
Total_Errors_Detected /= 0
- or else (Warnings_Detected - Info_Messages /= 0
+ or else (Warnings_Detected - Warning_Info_Messages /= 0
and then Warning_Mode = Treat_As_Error)
or else Warnings_Treated_As_Errors /= 0;
end Compilation_Errors;
===================================================================
@@ -305,12 +305,14 @@
-- Bump appropriate statistics counts
if Errors.Table (Cur_Msg).Info then
- Info_Messages := Info_Messages + 1;
-- Could be (usually is) both "info" and "warning"
if Errors.Table (Cur_Msg).Warn then
+ Warning_Info_Messages := Warning_Info_Messages + 1;
Warnings_Detected := Warnings_Detected + 1;
+ else
+ Report_Info_Messages := Report_Info_Messages + 1;
end if;
elsif Errors.Table (Cur_Msg).Warn
@@ -548,19 +550,19 @@
Write_Str (" errors");
end if;
- if Warnings_Detected - Info_Messages /= 0 then
+ if Warnings_Detected - Warning_Info_Messages /= 0 then
Write_Str (", ");
- Write_Int (Warnings_Detected - Info_Messages);
+ Write_Int (Warnings_Detected - Warning_Info_Messages);
Write_Str (" warning");
- if Warnings_Detected - Info_Messages /= 1 then
+ if Warnings_Detected - Warning_Info_Messages /= 1 then
Write_Char ('s');
end if;
if Warning_Mode = Treat_As_Error then
Write_Str (" (treated as error");
- if Warnings_Detected - Info_Messages /= 1 then
+ if Warnings_Detected - Warning_Info_Messages /= 1 then
Write_Char ('s');
end if;
@@ -586,13 +588,13 @@
end if;
end if;
- -- Even though info messages are a subclass of warnings, they must not
- -- be treated as errors when -gnatwe is in effect.
+ -- Even though Warning_Info_Messages are a subclass of warnings, they
+ -- must not be treated as errors when -gnatwe is in effect.
if Warning_Mode = Treat_As_Error then
Total_Errors_Detected :=
- Total_Errors_Detected + Warnings_Detected - Info_Messages;
- Warnings_Detected := Info_Messages;
+ Total_Errors_Detected + Warnings_Detected - Warning_Info_Messages;
+ Warnings_Detected := Warning_Info_Messages;
end if;
-- Prevent displaying the same messages again in the future
@@ -612,7 +614,8 @@
Serious_Errors_Detected := 0;
Total_Errors_Detected := 0;
Warnings_Detected := 0;
- Info_Messages := 0;
+ Warning_Info_Messages := 0;
+ Report_Info_Messages := 0;
Cur_Msg := No_Error_Msg;
-- Initialize warnings table, if all warnings are suppressed, supply
===================================================================
@@ -39,10 +39,11 @@
-- from invalid values in such cases.
-- Note on error counts (Serious_Errors_Detected, Total_Errors_Detected,
- -- Warnings_Detected, Info_Messages). These counts might more logically
- -- appear in this unit, but we place them instead in atree.ads, because of
- -- licensing issues. We need to be able to access these counts from units
- -- that have the more general licensing conditions.
+ -- Warnings_Detected, Warning_Info_Messages, Report_Info_Messages). These
+ -- counts might more logically appear in this unit, but we place them
+ -- instead in atree.ads, because of licensing issues. We need to be able
+ -- to access these counts from units that have the more general licensing
+ -- conditions.
----------------------------------
-- Error Message Mode Variables --