bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getdelim doesn't set errno on failure?


From: Oskar Liljeblad
Subject: Re: getdelim doesn't set errno on failure?
Date: Wed, 24 Aug 2005 16:20:17 +0200
User-agent: Mutt/1.5.10i

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]