--- Comment #5 from burnus at gcc dot gnu dot org 2008-12-15 20:35 ---
(In reply to comment #4)
> > In any case: I tried ifort, g95, NAG f95, gfortran, and sunf95
> > - of these only "ifort" allows it
>
> as you said using C_LOC(X(1:1)) works fine and that is what I ended up doing.
> BTW
--- Comment #4 from brtnfld at hdfgroup dot org 2008-12-15 16:52 ---
>
> In any case: I tried ifort, g95, NAG f95, gfortran, and sunf95 - of these only
> "ifort" allows it (even with all checking enabled - thus presumably only by
> accident and not on purpose).
>
> Thus I wonder wheth
--- Comment #3 from burnus at gcc dot gnu dot org 2008-12-15 10:48 ---
I think the patch in comment 2 is about the wrong gfc_error.
Additionally, the generic resolution seems to be correct in gfortran (-> PR
38506).
* * *
In any case: I tried ifort, g95, NAG f95, gfortran, and sunf95
--- Comment #2 from burnus at gcc dot gnu dot org 2008-12-12 16:19 ---
I have the gut feeling that the program in comment 1 is valid, even though
gfortran, g95, ifort and NAG f95 reject it. See PR 38506.
Regarding the c_loc: I think that should be possible; I'm not 100% sure whether
the
--- Comment #1 from brtnfld at hdfgroup dot org 2008-07-14 20:45 ---
For the simple program,
PROGRAM main
USE ISO_C_BINDING
CHARACTER(LEN=2, KIND=C_CHAR), TARGET :: chr
TYPE(C_PTR) :: chr_ptr
chr_ptr = C_LOC(chr)
END PROGRAM main
the work around is to:
CHARACTER(LEN=1, KIND=C_