[Top][All Lists]
[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.
- Re: getline.h, (continued)
- Re: getline() behaviour change, Bruno Haible, 2007/08/22
- Re: getline() behaviour change, Jim Meyering, 2007/08/22
- Re: getline() behaviour change, Bruno Haible, 2007/08/22
- Re: getline() behaviour change, Ben Pfaff, 2007/08/22
- Re: getline() behaviour change, Eric Blake, 2007/08/22
- Re: getline() behaviour change, Jim Meyering, 2007/08/24
- Re: getline() behaviour change, Jim Meyering, 2007/08/23
- do not set errno after failing malloc [Re: getline() behaviour change,
Jim Meyering <=
- Re: getline() behaviour change, Eric Blake, 2007/08/22