[Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)

Christopher D. Rickett crickett@lanl.gov
Wed Feb 14 16:17:00 GMT 2007


> Tobias Burnus wrote:
>> As found when reading the VALUE implementation by Chris.
>> gfortran currently accepts "character(*), value", but it shouldn't:

did the fortran-experiments branch correctly handle this?  i believe i
added a check to correctly disallow this, because for C interop, the
standard says further that the length is either omitted or "specified by
an initialization expr whose value is one" (section 15.3.2, pg. 396:5-7). 
i'm not sure about the case where the string is not needed to be C
interoperable though.

Chris

>> The question is whether "character(10), value" is allowed. xlf, NAG f95
and sunf95 reject it; gfortran, g95 and ifort accept it.
>
> Well, "10" certainly looks like an initialization expression to me!  It
also seems to be the simplest case of the application of that rule (aside
from the "length type parameter omitted altogether" case), so I'd be
inclined to guess that it's allowed, but I'm not familiar enough with that
part of the standard to be completely sure.
>
> - Brooks
>
>







More information about the Fortran mailing list