Transposed array as actual argument

Mikael Morin mikael.morin@sfr.fr
Sun Aug 22 19:26:00 GMT 2010


Le 22.08.2010 19:21, N.M. Maclaren a écrit :
>
> On Aug 22 2010, Mikael Morin wrote:
>> Le 22.08.2010 18:16, Tobias Burnus a écrit :
>>>
>>>> For example, I expect the following code to output four ones.
>>>> [...]
>>>> The output is four twos. Is that correct ?
>>>> If not I will open a PR for it.
>>>
>>> Other compilers give [1 1 1 1] - however, I belief that both results are
>>> correct as the the argument is not definable. If you use INTENT(INOUT)
>>> you will get the error message:
>>>
>>> Error: Actual argument at (1) must be definable as the dummy argument
>>> 'b' is INTENT = OUT/INOUT
>>>
>> Thanks for your answer.
>> Unfortunately it means more work for me :-(
>
> Why? As it's undefined behaviour, you are entitled to return anything
> you like - e.g. 97 61 13 7, except on alternate Thursdays, when you return
> 1 2 3 4. Just leave your code if you don't want to issue an error message.
> Or is that what you meant?
>
The current implementation is fast in all cases and correct in the 
defined cases, thus I have to be at least as good in all cases if I want 
to change it.



More information about the Fortran mailing list