diff options
author | Claire Dross <dross@adacore.com> | 2020-02-10 14:51:30 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-08 03:50:55 -0400 |
commit | ae9293fb8e1895006ce33069eaabdecfe65c46a2 (patch) | |
tree | 5021f4f07b780feffbba7e4adeb088db1f75ffff | |
parent | d2f7fa08bd557db89d771b648631bb98c61a631e (diff) | |
download | gcc-ae9293fb8e1895006ce33069eaabdecfe65c46a2.tar.gz |
[Ada] Silence spurious warning on instances of formal vectors
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.
-rw-r--r-- | gcc/ada/libgnat/a-cofove.adb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/a-cofove.adb b/gcc/ada/libgnat/a-cofove.adb index 6835503928a..41c69a8cc9a 100644 --- a/gcc/ada/libgnat/a-cofove.adb +++ b/gcc/ada/libgnat/a-cofove.adb @@ -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 |