+2018-05-23 Bob Duff <duff@adacore.com>
+
+ * libgnat/a-convec.adb: (Insert, Insert_Space): Suppress warnings. The
+ code in question is not reachable in the case where Count_Type'Last is
+ out of range.
+
2018-05-23 Yannick Moy <moy@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Clarify meaning of
-- We know that No_Index (the same as Index_Type'First - 1) is
-- less than 0, so it is safe to compute the following sum without
- -- fear of overflow.
+ -- fear of overflow. We need to suppress warnings, because
+ -- otherwise we get an error in -gnatwE mode.
+ pragma Warnings (Off);
Index := No_Index + Index_Type'Base (Count_Type'Last);
+ pragma Warnings (On);
if Index <= Index_Type'Last then
-- We know that No_Index (the same as Index_Type'First - 1) is
-- less than 0, so it is safe to compute the following sum without
- -- fear of overflow.
+ -- fear of overflow. We need to suppress warnings, because
+ -- otherwise we get an error in -gnatwE mode.
+ pragma Warnings (Off);
Index := No_Index + Index_Type'Base (Count_Type'Last);
+ pragma Warnings (On);
if Index <= Index_Type'Last then