[gfortran] Fix NULL reference types.
Toon Moene
toon@moene.indiv.nluug.nl
Fri Aug 20 21:35:00 GMT 2004
Paul Brook wrote:
> ie. is the following program legal?
>
> subroutine sub1(a, b)
> if (a > 0) b = log(a)
> end
>
> program prog
> integer i, j
> call sub1(0, 0)
> i = 1
> call sub1(i, j)
> end program
>
> Does the fact that b is redefined on some invocations of sub1 imply that every
> actual argument associated with b must be definable?
I think it does, because, on independent compilation, a processor
(compiler, assembler, linker, loader, etc.) can't be sure that there is
a call sub1(0,0), so it'll assume full rights to do copy in, copy out as
valid by the various Fortran Standards.
IOW, it means that the main program is in error here. Indeed the
invocations of sub1 need different "instantiations" of sub1, while that
isn't possible under an independent compilation regime.
We could ask on comp.lang.fortran if you doubt this reasoning, though.
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/
More information about the Fortran
mailing list