can this be treated as bug in fortran?

Richard E Maine Richard.Maine@nasa.gov
Wed Nov 16 19:23:00 GMT 2005


On Nov 16, 2005, at 10:27 AM, Uttam Pawar wrote:

> I've a following case, where dangling pointer is not detected. I'll 
> file
> it as a bug report if it indeed is bug (i think it is) but still need 
> an
> opinion.

It certainly is not a standard-conformance bug. The standard does not 
require detection of dangling pointers and many compilers don't do it. 
It would only be a bug if gfortran claimed to have such a feature. I 
haven't checked to see if there is any such claim (but I'd be mildly 
surprised if there were).

> May be I can do this with allocatable pointer too?

There is no such thing as an "allocatable pointer", which makes it hard 
for me to understand this part of the question. I think you probably 
mean a pointer that was associated using an allocate statement. That 
might be referred to as an allocated pointer, but it is not 
allocatable. It is perhaps confusing that an allocate statement can be 
used for things that do not have the allocatable attribute, but I'm 
afraid that confusion is in the standard.

In any case, dangling pointer detection is not required by the standard 
in any situation.

-- 
Richard Maine                |  Good judgment comes from experience;
Richard.Maine@nasa.gov       |  experience comes from bad judgment.
                             |        -- Mark Twain



More information about the Fortran mailing list