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: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jun 2007 19:05:04 -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 #2 from dfranke at gcc dot gnu dot org 2007-06-21 19:05 -------
> * An INTEGER SELECT construct has a CASE that can never be matched as its
> lower value is greater than its upper value.
In these cases, no error is shown (integer(kind=1) :: i):
select case (i)
case (300)
case (301:399)
case (400)
end select
But:
select case (i)
case (400:300)
end select
results in:
case (400:300)
1
Error: Arithmetic overflow converting INTEGER(4) to INTEGER(1) at (1)
(and an "Internal Error" as a follow-up).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31820