This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3] malloc: Add realloc test.


On Thu, Mar 26, 2015 at 3:25 PM, Andreas Schwab <schwab@suse.de> wrote:
> Will Newton <will.newton@linaro.org> writes:
>
>> +  p = realloc (NULL, 10);
>> +  save = errno;
>> +
>> +  if (p == NULL)
>> +    merror ("realloc (NULL, 10) failed.");
>> +
>> +  /* errno should be clear on success (POSIX).  */
>> +  if (p != NULL && save != 0)
>> +    merror ("errno is set but should not be");
>
> Where does it say that?

As far as I can tell POSIX doesn't, I think that's a bug. Although
whether we should ensure glibc's implementation of realloc behaves
this way or not is another matter.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]