bug-gnulib
[Top][All Lists]
Advanced

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

do not set errno after failing malloc [Re: getline() behaviour change


From: Jim Meyering
Subject: do not set errno after failing malloc [Re: getline() behaviour change
Date: Thu, 23 Aug 2007 08:15:27 +0200

Bruno Haible <address@hidden> wrote:
> Jim Meyering wrote:
>> Are you advocating support for non-POSIX malloc/realloc?
>
> Sure. gnulib supports - to a large extent - mingw. It uses a malloc
> implementation from msvcrt.dll. This malloc does not set errno.

You're dumbing down gnulib to accommodate _mingw_?!?
Please, don't do that.

Add a wrapper, rather than polluting all application code.
This is a fundamental tenet of gnulib:
If there's some portability problem, gnulib allows all of its client
code to assume the desired behavior.  Nonconforming hosts like mingw
can endure the run-time overhead of wrappers or replacement functions.
That's far cleaner than polluting malloc-using applications with
obscure code to set errno upon malloc failure.




reply via email to

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