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,fix, PING] PR21875 Internal Array IO and NIST final fix


Erik Zeek wrote:
On Wed September 14 2005 10:33 am, Jerry DeLisle wrote:

The only surprising bit is this:
+   if (*len < 0)  /* This should never happen */
+     *len = 0;
+
So if it never happens, why have it?

I put that in there to flag out an issue in review (which it has). There was a point where len was actually going negative and causing a segfault. I put that there to catch that condition long enough for me to see what was happening to fix it.

Its sort of a policy question.  Leaving it may prevent a future segfault
if something starts going wrong again.  It would allow us to see bad
output rather than a segfault.  Other than that, there is no need.  I
will take it out.

With these changes I assume that it is OK to commit to 4.0 after
retesting.

Typo above, should have been 4.1


Why not issue an error or warning if len is negative? If you had problems with it, another developer might as well (and not realize exactly where the problems is).


Erik


Good point, but gets back to a philosophy question. (I am talking myself through this.) It seems any value or pointer could go wrong from future bugs, so is this one special other than I saw it go south before.


I think I will take it out and double check that its not doing that anymore and add a comment for future reference. Down the road developers will see the comment and know to check it.

Does that seem reasonable?

Jerry


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