[Ada] Check for "size for" in Special_Msg_Delete

2019-12-16  Bob Duff  <duff@adacore.com>

gcc/ada/

	* errout.ads, errout.adb (Is_Size_Too_Small_Message): Check for
	"size for" instead of "size for& too small, minimum allowed is
	^".

From-SVN: r279438
This commit is contained in:
Bob Duff 2019-12-16 10:35:09 +00:00 committed by Pierre-Marie de Rodat
parent 1cbd208038
commit eb2ff584d5
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2019-12-16 Bob Duff <duff@adacore.com>
* errout.ads, errout.adb (Is_Size_Too_Small_Message): Check for
"size for" instead of "size for& too small, minimum allowed is
^".
2019-12-16 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Set only

View File

@ -1710,6 +1710,17 @@ package body Errout is
Specific_Warnings.Init;
end Initialize;
-------------------------------
-- Is_Size_Too_Small_Message --
-------------------------------
function Is_Size_Too_Small_Message (S : String) return Boolean is
Size_For : constant String := "size for";
begin
return S'Length >= Size_For'Length
and then S (S'First .. S'First + Size_For'Length - 1) = Size_For;
end Is_Size_Too_Small_Message;
-----------------
-- No_Warnings --
-----------------
@ -3259,7 +3270,7 @@ package body Errout is
-- Processing for "Size too small" messages
elsif Msg = Size_Too_Small_Message then
elsif Is_Size_Too_Small_Message (Msg) then
-- Suppress "size too small" errors in CodePeer mode, since code may
-- be analyzed in a different configuration than the one used for

View File

@ -954,6 +954,7 @@ package Errout is
-- WARNING: There is a matching C declaration of this subprogram in fe.h
function Is_Size_Too_Small_Message (S : String) return Boolean;
Size_Too_Small_Message : constant String :=
"size for& too small, minimum allowed is ^";
-- This message is explicitly tested in Special_Msg_Delete in the package