Add a Boolean overload of Warnings_Suppressed that wraps the existing
String_Id version, simplifying call sites that only need to know whether
warnings are suppressed at a location rather than the suppression reason.
gcc/ada/ChangeLog:
* erroutc.ads (Warnings_Suppressed): New Boolean overload.
* errout.adb (Error_Msg_Internal): Use Boolean Warnings_Suppressed.
* errutil.adb (Error_Msg): Likewise.
-- that style checks are not considered warning messages for this
-- purpose.
- if Error_Msg_Kind = Warning
- and then Warnings_Suppressed (Orig_Loc) /= No_String
- then
+ if Error_Msg_Kind = Warning and then Warnings_Suppressed (Orig_Loc) then
return;
-- For style messages, check too many messages so far
-- Immediate return if warning message and warnings are suppressed
- if Warnings_Suppressed (Optr) /= No_String
- or else Warnings_Suppressed (Sptr) /= No_String
- then
+ if Warnings_Suppressed (Optr) or else Warnings_Suppressed (Sptr) then
Cur_Msg := No_Error_Msg;
return;
end if;
-- parameter from the pragma is returned (or the null string if no Reason
-- parameter was present).
+ function Warnings_Suppressed (Loc : Source_Ptr) return Boolean
+ is (Warnings_Suppressed (Loc) /= No_String);
+ -- Returns true if there is a reason for the warnings to be suppressed at
+ -- this location.
+
function Warning_Specifically_Suppressed
(Loc : Source_Ptr;
Msg : String_Ptr;
-- Immediate return if warning message and warnings are suppressed.
-- Note that style messages are not warnings for this purpose.
- if Error_Msg_Kind = Warning
- and then Warnings_Suppressed (Sptr) /= No_String
- then
+ if Error_Msg_Kind = Warning and then Warnings_Suppressed (Sptr) then
Cur_Msg := No_Error_Msg;
return;
end if;