[Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables

zbeekman at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 4 20:52:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #7 from Zaak <zbeekman at gmail dot com> ---
(In reply to Dominique d'Humieres from comment #1)
> AFAICT the substring problem occurs for PARAMETER only:
> 
> program test3
>   INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
>   CHARACTER(3,UCS4),PARAMETER ::
> unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),
> ucs4)
>   character(3,UCS4) :: uni
>   uni = unip
>   open(6, encoding="utf-8")
>   print *, uni
>   print *, uni(2:2)
>   print *, unip
>   print *, "'",unip(1:1),"'"
> end program test3
> 
> gives at run time
> 
>  年月日
>>  年月日
>  't'

As Dominique noted a problem does exist with ISO 10646 characters with the
parameter attribute. Pleas see PR 65151
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141 for more details


More information about the Gcc-bugs mailing list