This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31820] Warning if case label value exceeds maximum value for type
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Aug 2007 14:38:58 -0000
- Subject: [Bug fortran/31820] Warning if case label value exceeds maximum value for type
- References: <bug-31820-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-08-15 14:38 -------
(In reply to comment #1)
> * An INTEGER SELECT construct has a CASE that can never be matched as its
> lower value is greater than its upper value.
It is also implemented:
$ cat u1.f90
integer :: i, j
select case (i)
case (251:250)
end select
end
$ gfortran u1.f90 -Wsurprising
u1.f90:3.10:
case (251:250)
1
Warning: Range specification at (1) can never be matched
When an error occurs, though, we will not display the warning, which is fine
IMHO. We still need to add a check for the initial testcase.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31820