Jim Meyering wrote: > Note that POSIX *does* require a failed malloc call to set errno to > ENOMEM, albeit with CX shading (meaning IEEE Std 1003.1-2001). > > http://www.opengroup.org/susv3xsh/malloc.html > > Let's try not to let substandard systems dictate interface design. > If some system has a poor implementation of a function like malloc > we can easily ensure that it is replaced.
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. Bruno _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib