This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what is the option I am looking for?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]