public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/slp-function-v2)] [Ada] Silence spurious warning on instances of formal vectors
@ 2020-06-11 10:00 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2020-06-11 10:00 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:ae9293fb8e1895006ce33069eaabdecfe65c46a2
commit ae9293fb8e1895006ce33069eaabdecfe65c46a2
Author: Claire Dross <dross@adacore.com>
Date: Mon Feb 10 14:51:30 2020 +0100
[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.
Diff:
---
gcc/ada/libgnat/a-cofove.adb | 4 ++++
1 file changed, 4 insertions(+)
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-06-11 10:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 10:00 [gcc(refs/users/marxin/heads/slp-function-v2)] [Ada] Silence spurious warning on instances of formal vectors Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).