[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: what is the option I am looking for?
From:       Richard E Maine <Richard.Maine () nasa ! gov>
Date:       2005-03-31 23:44:12
Message-ID: 52faef0f6d3759ec1f158c67a83a67c9 () nasa ! gov
[Download RAW message or body]

On Mar 31, 2005, at 3:17 PM, Kamaraju Kusumanchi wrote:

> A good compiler should point out that 'gen' is an unallocated array
> and calling its size does not make any sense.

The code isn't asking about the size of gen; it is asking about the 
size of temp, which is not the same thing. Yes, I know that the two 
arrays get argument associated, but that does *NOT* make them the same 
thing. I  doubt that any compiler in the world would complain about the 
usage of size(). That would sure strike me as strange.

The error in the code is not in the use of size, but in passing an 
unallocated array as an actual argument to anything other than an 
allocatable dummy. That might plausibly be diagnosable, but most likely 
only at run time. I don't know if gfortran can catch that, but in 
general look for options to detect run-time usage of pointers that are 
not associated or allocatables that are not allocated.

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic