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


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