Klaus Ramstöck writes:
> So I remembered that my NAG f95 seems to pass optional arguments as
> null pointers:...
[example program elided]
> I doubt it is very portable, my f90 texts say nothing about how
> optionals are to be implemented.
*VERY* non-portable. Indeed, it wouldn't surprise me at all for
this to change with some subsequent compiler release.
> Besides- maybe this is a compiler bug?
Sort of. Its illegal code in that you dereference a null pointer.
You aren't allowed to do that. Neither is the compiler required to
check for such things. So its not strictly speaking a compiler
bug, though it is nice for compilers to at least have options
for such things.
Try the checking options on NAG. Easiest is -C=all. The
one of most interest is probably -C=pointer, though -C=present
and -C=calls seem possibly relevant also.
--
Richard Maine
[log in to unmask]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|