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 portabi
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
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 wrapp
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 accommod
-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.
>
> W
-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.
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
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 i
Hi Bruno,
Thanks for all the reviews.
I haven't had time to look at the rest, but the following stood out:
Bruno Haible <[EMAIL PROTECTED]> wrote:
> The POSIX spec implies that errno should be set when getdelim fails. Therefore
> errno needs to be set not only here, with EOVERFLOW. In lines 77 an
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
10 matches
Mail list logo