Subject: Re: CVS commit: basesrc/lib/libc/stdlib
To: None <itojun@iijlab.net>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-userlevel
Date: 07/30/2002 15:09:36
itojun@iijlab.net wrote:
> >I don't think such babysitting should be done, I don't think such
> >gratuitous change should be done. I'd go as far as saying that
> >this change is broken. Let's discuss this change on tech-userlevel.
> 
> 	then what should happen if
> 		x = calloc(0x10000000, 17);
> 	on 32bit arch?  it sure will cause integer overflow.
> 	the commit will make it return NULL (allocation failure).

It's not libc's business to care about this IMHO.
Why should this change be done? Does it solve any real problem?
Checks like these should be within #ifdef _DIAGNOSTIC.

Jaromir 
-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-