Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <offuvn2qlt5c5rc6kqjkz7godv6g7lz4mo2xooz34ptuzgr5jl@f56p43qrldze>
Date: Wed, 18 Jun 2025 20:05:34 +0200
From: Alejandro Colomar <alx@...nel.org>
To: Andreas Schwab <schwab@...e.de>
Cc: enh <enh@...gle.com>, Florian Weimer <fweimer@...hat.com>, 
	musl@...ts.openwall.com, Rich Felker <dalias@...c.org>, 
	Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>, libc-alpha@...rceware.org, Joseph Myers <josmyers@...hat.com>, 
	наб <nabijaczleweli@...ijaczleweli.xyz>, Paul Eggert <eggert@...ucla.edu>, 
	Robert Seacord <rcseacord@...il.com>, Bruno Haible <bruno@...sp.org>, bug-gnulib@....org, 
	JeanHeyd Meneide <phdofthehouse@...il.com>
Subject: Re: BUG: realloc(p,0) should be consistent with malloc(0)

Hi Andreas,

On Wed, Jun 18, 2025 at 05:42:40PM +0200, Andreas Schwab wrote:
> On Jun 17 2025, Alejandro Colomar wrote:
> 
> > RETURN VALUE
> >
> >         If size is 0,
> >         ...
> >         either:
> >
> >             -  A null pointer shall be returned
> >                and, if ptr is not a null pointer,
> >                errno shall be set to EINVAL.
> >
> >             -  A pointer to the allocated space shall be returned,
> >                and the memory object pointed to by ptr shall be freed.
> >                 ...
> >
> 
> Note that all of this is marked obsolescent.

Note that it's marked obsolescent because ISO C has turned this into UB.
If ISO C defines the behavior again, then the obsolescence of this could
be reverted.


Have a lovely day!
Alex

-- 
<https://www.alejandro-colomar.es/>

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.