people's expectations
Jerry DeLisle
jvdelisle@charter.net
Thu Jan 17 02:08:00 GMT 2019
On 1/16/19 8:21 AM, Steve Kargl wrote:
> On Wed, Jan 16, 2019 at 09:41:32AM +0100, Manfred Schwarb wrote:
>> Am 16.01.2019 um 01:47 schrieb Steve Kargl:
>>> What are people's expectation for gfortran with this code:
>>>
>>> subroutine bar
>>> integer, external :: j
>>> read(*,*) j
>>> print *, j()
>>> end subroutine bar
>>>
>>
>> i would expect the very same error as for
>>
>> subroutine bar
>> integer, external :: j
>> j=1
>> print *, j()
>> end subroutine bar
>>
>> Error: Illegal assignment to external procedure at (1)
>>
>
> Technically, it isn't an assignment. The READ statement
> causes an input-item to become defined. Yes, I know it's
> just semantics, but then again fixing the bug requires
> following the standard.
>
If j is an external function as in C which takes no argument, such a
maybe a random number generator, shouldn't it resolve to a call of that
function and return a value that is printed?
Or even a fortran function I suppose.
Jerry
More information about the Fortran
mailing list