Eric Blake wrote:
I would somewhat like this idea - it is much nicer assuming that malloc
reliably sets errno to ENOMEM on failure than having to patch all callers
of malloc to do the same.
Jim Meyering confirmed:
Yes. This is a fundamental goal of gnulib:
If there is some portability
Eric Blake [EMAIL PROTECTED] wrote:
According to Ben Pfaff on 8/22/2007 5:19 PM:
Bruno Haible [EMAIL PROTECTED] writes:
Jim Meyering wrote:
A *lot* of code expects malloc and realloc to set errno when they fail.
Such code is not portable to plain ISO C 99 systems.
We could extend gnulib's
Bruno Haible [EMAIL PROTECTED] 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
Ben Pfaff [EMAIL PROTECTED] wrote:
Bruno Haible [EMAIL PROTECTED] writes:
Jim Meyering wrote:
A *lot* of code expects malloc and realloc to set errno when they fail.
Such code is not portable to plain ISO C 99 systems.
We could extend gnulib's existing malloc/realloc wrappers to
ensure
Hi Eric,
The patch includes a couple of bug fixes in getdelim.c:
It is valid on entrance for *lineptr to be non-NULL but *n to be 0 (ie.
via malloc(0)), but your implementation was leaking that memory. Also,
your implementation failed to set errno to EOVERFLOW when it detects that
it
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.
A *lot* of code expects malloc and realloc to set errno when they fail.
Such code is
Bruno Haible [EMAIL PROTECTED] writes:
Jim Meyering wrote:
A *lot* of code expects malloc and realloc to set errno when they fail.
Such code is not portable to plain ISO C 99 systems.
We could extend gnulib's existing malloc/realloc wrappers to
ensure that malloc/realloc set errno when they
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Bruno Haible on 8/22/2007 3:25 PM:
- if (*lineptr == NULL || *n == 0)
+ if (*n == 0)
This is a behaviour change: Previously when *lineptr == NULL, *n did not
need to be initialized. Now it needs to be initialized to 0. Should
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Ben Pfaff on 8/22/2007 5:19 PM:
Bruno Haible [EMAIL PROTECTED] writes:
Jim Meyering wrote:
A *lot* of code expects malloc and realloc to set errno when they fail.
Such code is not portable to plain ISO C 99 systems.
We could