This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH,fortran] Relax restrictions on KIND in SELECT CASE constructs
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>,gcc-patches at gcc dot gnu dot org
- Date: Mon, 27 Dec 2004 13:46:16 +0000
- Subject: Re: [PATCH,fortran] Relax restrictions on KIND in SELECT CASE constructs
- Organization: CodeSourcery
- References: <20041217204951.GA85681@troutmask.apl.washington.edu>
> 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