From: Bob Duff Date: Mon, 16 Dec 2019 10:35:09 +0000 (+0000) Subject: [Ada] Check for "size for" in Special_Msg_Delete X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb2ff584d58ac4664ff3e99d5fe7bf9eaa262bec;p=gcc.git [Ada] Check for "size for" in Special_Msg_Delete 2019-12-16 Bob Duff 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 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index e47c8382c3b..078a238de37 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2019-12-16 Bob Duff + + * 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 * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Set only diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 42c7cb90477..46e223f8d69 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -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 diff --git a/gcc/ada/errout.ads b/gcc/ada/errout.ads index dfa6b8671f3..64acff496ca 100644 --- a/gcc/ada/errout.ads +++ b/gcc/ada/errout.ads @@ -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