On Wednesday, August 24, 2005 at 15:52, Bruno Haible wrote: > > I'm not in favour of a wrapper around malloc(), that would add overhead to > a function called as frequently as malloc(), just to set 'errno'. > > ISO C 99 is not a "substandard", and Windows malloc() is not "poor" just > because it does not set errno. > > What value do you expect in errno after malloc() failed? ENOMEM is > the most frequent and maybe also the only reasonable choice when malloc() > fails. What's the purpose then of setting errno then? > > ISO C 99 is not a "substandard", and Windows malloc() is not "poor" just > because it does not set errno.
Gnulib already has a replacement malloc that handles malloc(0). Why not extend that to set errno on failure as well? Also, if we are to emulate a standard for broken systems, why not emulate POSIX? Regards, Oskar _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib