Jan van Oosterwijk wrote:
> At 17:07 29-03-2004 +0100, John Reid wrote:
>
>> Jan van Oosterwijk wrote:
>>
>>> Hello,
>>>
>>> At 00:39 30-03-2004 +1000, Robin wrote:
>>>
>>>> > Date: Sun, 28 Mar 2004 21:58:36 -0500
>>>> > From: Jean Vezina <[log in to unmask]>
>>>>
>>>> > Here is another case that cause problems with some compilers:
>>>> >
>>>> > character*5 a
>>>> > call test(a,'123')
>>>> > print *,a
>>>> > end
>>>> > subroutine test(a,b)
>>>> > ! the problem statement is the IMPLICIT
>>>> > implicit character(*) (a-z)
>>>> > a = b
>>>> > end
>>>> >
>>>> > The problematic statement is the IMPLICIT CHARACTER(*). I think this
>>>> > was prohibited in Fortran 77, but in Fortran 95 ?
>>>>
>>>> Should be OK.
>>>> But what about an explicit interface etc?
>>>
>>>
>>>
>>> I tried two compilers, who rejected the IMPLICIT statement.
>>> Then I looked in the standard and found in 5.1.1.5 :
>>>
>>> " A character length parameter value of * may be used only in the
>>> following ways:
>>> " (1) ... to declare a dummy argument of a procedure, ...
>>> " (2) ... to declare a named constant ...
>>> " (3) In an external function, the name of the function result may be
>>> specified with a character length parameter value of *; ... "
>>>
>>> What do the experts say about this ?
>>
>>
>> No problem. Here, we have case (1).
>>
>> John Reid.
>
>
> Well, I tried a third compiler, which also rejected the program,
> giving me reason to conclude that all three tested by me,
> interpret the above cited restriction as
> allowing (*) in type declaration statements only.
>
> John seems to extend the permitted use of (*) to the <type-spec> of an
> IMPLICIT statement.
> I venture to disagree with John Reid's larger interpretation.
> He certainly is more expert in standard matters than I am, so
> must I conclude that I have three compilers with the same bug ?
>
> Waiting for the decision of the real experts...
>
Well, I'm not dumb enough to call myself a realer expert
than John, but here's my take.
Rule 541 and following say an implicit statement is
IMPLICIT type-spec(letter-spec-list)
and from R502 type-spec is
... CHARACTER [char-selector]
and from R507 and following
char-selector is ( * )
and I didn't see any constraints that limited this to just
type selectors, so I think the IMPLICIT can have
CHARACTER (*) as the type-spec.
Another couple of posts said an explicit interface was
needed. Does anyone know why? I thought character
dummies with a length of (*) did NOT require an
explicit interface.; at least there's nothing in
12.3.1.1 that requires an explicit interface.
Dick Hendrickson
>
> \---
>
> Best regards,
>
> Jan van Oosterwijk | "They that can give up essential liberty
> Netherlands | to obtain a little temporary safety deserve
> | neither liberty nor safety."
> | -- Benjamin Franklin (1759)
>
> write(*,*)transfer((/778985834,1869504886,1702130543,1785296754 &
> &,1635205227,1868849518,1819160175 /),(/'x'/)) ; end
>
> mailto:Jan<dot>vanOosterwijk<at>wanadoo<dot>NL
> http://huizen<dot>dto<dot>tudelft<dot>nl/vanOosterwijk/
>
|