This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH,fortran] Relax restrictions on KIND in SELECT CASE constructs


> 2004-12-17  Steven G. Kargl  <kargls@comcast.net>
>
>      * resolve.c (validate_case_label_expr): Fix handling of mismatched
> KINDs.

No.

program foo
  integer i
  select case (i)
  case (0_4)
  case (1_8)
  end select
end program

Gives:

      SELECT CASE __convert_i4_i8[[((i))]]
      CASE (0 0)
      CASE (1_8 1_8)
      END SELECT

Which is obviously wrong.

We should probably convert all cases to the type of the select expression. Out 
of range values should either error, or warn and remove that case.

Paul


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