This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/31820] Warning if case label value exceeds maximum value for type



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]