[patch, libgfortran] Fix PR20257 End of record occurs when writing large arrays

Thomas Koenig Thomas.Koenig@online.de
Sat Apr 22 19:46:00 GMT 2006


On Sat, Apr 22, 2006 at 07:26:17AM +0200, Paul Thomas wrote:
> Jerry,
> 
> :REVIEWMAIL:
> 
> The patch is OK to commit, except:
> 
> >You will notice an absurd unit number being assigned to internal 
> >units.  It turns out that the stderr unit number is zero.  To avoid 
> >mistaking an internal unit as preconnected I set it to 135790.  This 
> >also eliminates a case of accessing an uninitialized value pointed out 
> >by valgrind.
> 
> In my experience, "absurd" numbers ALWAYS come back to bite you.  Use 
> something determinable, like 2^31.  This needs to be documented and, 
> preferably, an attempt to open unit = what_ever_you_chose should produce 
> a warning that this is reserved internally.

We can reserve a few numbers for internal use - say, 2**31-1024 to 2**31-1
(the maximum positive GFC_INTEGER_4).  Attempts to open or otherwise use
these should be an error, and inquire(exist) could return false, like
negative numbers right now.

Does this sound reasonable?

	Thomas



More information about the Gcc-patches mailing list