This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran,patch] Add SELECTED_CHAR_KIND intrinsic
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: FX <fxcoudert at gmail dot com>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 30 Apr 2008 22:19:39 +0200
- Subject: Re: [fortran,patch] Add SELECTED_CHAR_KIND intrinsic
Hello FX,
FX wrote:
> PS: Jerry, what's the status of ENCODING="..." I/O specifier? Can we
> already claim that we support Fortran 2003 international character sets
> (the requirements for that are fairly low, as quite a few compilers have
> a "yes" in that column and I know none that actually supports any
> nondefault character kind).
I think with that patch we support about as much as other compilers, but
still I would only claim PARTIAL, following NAG f95 which also has only
ASCII support. Actually, the library implementation has a diagnostic
bug. The following should give a run-time error (the compile-time diagnostic
is OK):
character(len=10) :: cc = 'UTF-8'
open(99,file="dd",encoding=cc)
write(*,*) 'HELLO'
end
The patch is OK, however, it took me a while to correctly read:
+ len = (alen > blen) ? alen : blen;
I somehow read: len = MIN(alen,blen) instead of MAX(...)
I therefore wonder whether one should add a comment somewhere.
Tobias
> gcc/fortran/ChangeLog
>
> 2008-04-30 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
>
> * intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.