+2019-12-16 Bob Duff <duff@adacore.com>
+
+ * errout.adb, errout.ads: Improve comments.
+
2019-12-16 Bob Duff <duff@adacore.com>
* sem_util.ads: Minor comment fix.
function Is_Size_Too_Small_Message (S : String) return Boolean is
Size_For : constant String := "size for";
+ pragma Assert (Size_Too_Small_Message (1 .. Size_For'Last) = Size_For);
+ -- Assert that Size_Too_Small_Message starts with Size_For
begin
return S'Length >= Size_For'Length
and then S (S'First .. S'First + Size_For'Length - 1) = Size_For;
+ -- True if S starts with Size_For
end Is_Size_Too_Small_Message;
-----------------
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
- -- body, which is somewhat questionable, but at least by using a constant
- -- we are obeying the DRY principle.
+ -- This message is printed in Freeze and Sem_Ch13. We also test for it in
+ -- the body of this package (see Special_Msg_Delete) ???which is somewhat
+ -- questionable. The Is_Size_Too_Small_Message function tests for it by
+ -- testing a prefix. The function and constant should be kept in synch.
end Errout;