This is the mail archive of the 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] mtrace: properly handle realloc (p, 0)

On 01/02/2013 04:02 PM, Andreas Schwab wrote:

> That paragraph does not contain the word "succeed".

True, but the paragraph contains other requirements such as
"The realloc() function shall change the size of the memory
object pointed to by ptr to the size specified by size",
requirements that cannot possibly be satisfied on failure.
Hence it's reasonable to interpret that paragraph as talking about
the success case, even if the success is only implied.

Mind you, I disagree with this interpretation and agree with you;
all I'm saying is that the interpretation is not unreasonable.

> the return value section talks about "successful completion" only in
> connection with non-zero size.

That doesn't mean that there's no notion of success or failure
with zero size.  All it means is that POSIX does not currently
specify whether NULL is a success value when the size is zero.

We are verging into standard-lawyering here; maybe we should
move this discussion to the Austin mailing list?  I don't sense
a consensus that glibc should change its behavior to conform
to the proposed change to C/POSIX, and that might be a problem
that they want to know about.

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