aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/errout.adb13
-rw-r--r--gcc/ada/errout.ads1
3 files changed, 19 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index e47c838..078a238 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index 42c7cb9..46e223f 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 dfa6b86..64acff4 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