]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Silence spurious warning on instances of formal vectors
authorClaire Dross <dross@adacore.com>
Mon, 10 Feb 2020 13:51:30 +0000 (14:51 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 8 Jun 2020 07:50:55 +0000 (03:50 -0400)
2020-06-08  Claire Dross  <dross@adacore.com>

gcc/ada/

* libgnat/a-cofove.adb (Insert_Space): The computation of Index
generates a spurious compiler warning about a value not being in
range for a statically dead branch.  Silence it using pragma
Warnings.

gcc/ada/libgnat/a-cofove.adb

index 6835503928acc0e8ce9212647f0bbac18462e9bc..41c69a8cc9aa54e8e2877423cbb7154ab3eb3a01 100644 (file)
@@ -868,7 +868,11 @@ is
             --  less than 0, so it is safe to compute the following sum without
             --  fear of overflow.
 
+            pragma Warnings
+              (Off, "value not in range of type ""T"" defined at line 4");
             Index := No_Index + Index_Type'Base (Count_Type'Last);
+            pragma Warnings
+              (On, "value not in range of type ""T"" defined at line 4");
 
             if Index <= Index_Type'Last then