+2019-08-19 Bob Duff <duff@adacore.com>
+
+ * errout.ads (Size_Too_Small_Message): New constant.
+ * errout.adb, freeze.adb, sem_ch13.adb: Use it.
+
2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
* exp_dist.adb (Build_Package_Stubs): Do not specifically visit
-- Processing for "Size too small" messages
- elsif Msg = "size for& too small, minimum allowed is ^" then
+ elsif Msg = Size_Too_Small_Message then
-- Suppress "size too small" errors in CodePeer mode, since code may
-- be analyzed in a different configuration than the one used for
-- This name is the identifier name as passed, cased according to the
-- default identifier casing for the given file.
+ 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
+ -- body, which is somewhat questionable, but at least by using a constant
+ -- we are obeying the DRY principle.
+
end Errout;
elsif Has_Size_Clause (T) then
if RM_Size (T) < S then
Error_Msg_Uint_1 := S;
- Error_Msg_NE
- ("size for& too small, minimum allowed is ^",
- Size_Clause (T), T);
+ Error_Msg_NE (Size_Too_Small_Message, Size_Clause (T), T);
end if;
-- Set size if not set already
if not ASIS_Mode then
Error_Msg_Uint_1 := Min_Siz;
- Error_Msg_NE ("size for& too small, minimum allowed is ^", N, T);
+ Error_Msg_NE (Size_Too_Small_Message, N, T);
end if;
end Size_Too_Small_Error;