BUG: realloc(p,0) is not conforming to C99/C11/C17/POSIX.1-2008

Maciej W. Rozycki macro@redhat.com
Tue Oct 29 15:11:09 GMT 2024


On Tue, 29 Oct 2024, Andreas Schwab wrote:

> >  Maybe it's a matter of rendering the web page, or how the PDF version has 
> > been formatted that I have no access to.  I can see three possibilities at 
> > the top level; cf. the screenshot attached.
> 
> If you compare it with the 2017 version, you see that the sentence
> beginning with "If size is 0" is (meant to be) part of the first
> paragraph (ie., a successful completion).  It's only the addition of the
> OB and CX markers that messed up the formatting (probably only in the
> online version).

 I did the comparison before sending the message you quoted, hence my 
conclusions made there.  Overall barring evidence otherwise I fail to see 
a reason to assume a normative document has been written incorrectly and 
read it other than literally.  If this paragraph separation is there, it 
is there.  And as I say I find it consistent with the rest of POSIX.

 This is also clearly what happened with AIX and its certification: even 
though common sense says, inferring from the rest of POSIX, that to set 
errno according to a way documented for a particular API constitutes an 
unsuccessful return, the literal text of POSIX.1-2017 says otherwise, so 
both the implementers and the certifiers followed the text literally and 
accepted the AIX semantics as compliant.  I think we need to do the same 
with POSIX.1-2024.

 Thanks for your input.

  Maciej



More information about the Libc-alpha mailing list