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: [Patch, fortran] PR37735 - Allocatable components in vectors of derived types cause ICE on assignment


Steve Kargl wrote:

I still don't get what you want.  Are the semantics of -fcheck-size
to permit the above code to compile and run?  I would prefer that
gfortran does not grow a bunch of crufty questionable options because
no one in 30 years has bother to fix their code.

Indeed you don't seem to understand.


Exceeding array bounds is wrong in general. However, it's most heinous when it also means you address outside of the array's extent (i.e., you either read bogus data outside of the array or you write (shudder) outside the array.

This is sufficiently more aggravating that making a distinction would be useful:

1. Warn (or error) on exceeding a single array bound.
2. Warn (or error) on an access/store from/to an array be outside its
   extent.

The last one at least warns if you are to read a completely unrelated value, but more importantly, would *write* over an unrelated value.

The first one is nice to have to know that your program (in this respect) is Standard conforming.

Kind regards,

--
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.indiv.nluug.nl/~toon/
Progress of GNU Fortran: http://gcc.gnu.org/ml/gcc/2008-01/msg00009.html


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