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: Jim Meyering
Subject: Re: getdelim doesn't set errno on failure?
Date: Wed, 24 Aug 2005 14:20:03 +0200

Bruno Haible <address@hidden> wrote:
> You cannot assume that malloc() and realloc() set errno upon failure.
>
>   - In ISO C 99, the description of malloc() and realloc() does not mention
>     errno. Also, <errno.h> is not required to declare a macro 'ENOMEM'.
>   - Windows (mingw) malloc() and realloc() don't always set errno.

Note that POSIX *does* require a failed malloc call to set errno to
ENOMEM, albeit with CX shading (meaning IEEE Std 1003.1-2001).

  http://www.opengroup.org/susv3xsh/malloc.html

Let's try not to let substandard systems dictate interface design.
If some system has a poor implementation of a function like malloc,
we can easily ensure that it is replaced.




reply via email to

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