BUG: realloc(p,0) is not conforming to C99/C11/C17/POSIX.1-2008
Paul Eggert
eggert@cs.ucla.edu
Mon Oct 28 19:35:28 GMT 2024
On 2024-10-28 09:47, Maciej W. Rozycki wrote:
> A new paragraph begins saying what happens in one specific case:
The RETURN VALUE section gives two possibilities at the top level. The
first is "Upon successful completion, ..."; the second is "If there is
not enough available memory, ...". The specific case you mention, which
lists as an option "A null pointer shall be returned", appears under the
"Upon successful completion" possibility. This case is successful
completion because the initial "Upon successful completion" sentence
explicitly lists returning a null pointer as being successful.
Under the reading you gave, the RETURN VALUE section would jump back and
forth and back and forth between describing successful and unsuccessful
completion, with no hint to the reader as to which behavior is intended
to be successful and which is not, and with one of the isolated
unsuccessful-completion behaviors just happening to not apply to glibc.
I don't find such a reading plausible: other RETURN VALUE sections
consistently list successful completion behaviors first, then
unsuccessful ones, and I see no reason why this RETURN VALUE section
would differ from the general pattern.
> Also who does this certification? The Austin Group or someone else?
It's the Open Group; see <https://posix.opengroup.org/>.
More information about the Libc-alpha
mailing list