![]() |
|
Message-ID: <1873538.z80rmPrJh6@nimes> Date: Tue, 24 Jun 2025 11:54:48 +0200 From: Bruno Haible <bruno@...sp.org> To: Florian Weimer <fweimer@...hat.com> Cc: Alejandro Colomar <alx@...nel.org>, libc-alpha@...rceware.org, bug-gnulib@....org, musl@...ts.openwall.com, наб <nabijaczleweli@...ijaczleweli.xyz>, Douglas McIlroy <douglas.mcilroy@...tmouth.edu>, Paul Eggert <eggert@...ucla.edu>, Robert Seacord <rcseacord@...il.com>, Elliott Hughes <enh@...gle.com>, JeanHeyd Meneide <phdofthehouse@...il.com>, Rich Felker <dalias@...c.org>, Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>, Joseph Myers <josmyers@...hat.com>, Laurent Bercot <ska-dietlibc@...rnet.org>, Andreas Schwab <schwab@...e.de>, Eric Blake <eblake@...hat.com>, Vincent Lefevre <vincent@...c17.net>, Mark Harris <mark.hsj@...il.com>, Collin Funk <collin.funk1@...il.com>, Wilco Dijkstra <Wilco.Dijkstra@....com>, DJ Delorie <dj@...hat.com>, Cristian Rodríguez <cristian@...riguez.im>, Siddhesh Poyarekar <siddhesh@...plt.org>, Sam James <sam@...too.org>, Mark Wielaard <mark@...mp.org>, "Maciej W. Rozycki" <macro@...hat.com>, Martin Uecker <ma.uecker@...il.com>, Christopher Bazley <chris.bazley.wg14@...il.com>, eskil@...ession.se, Daniel Krügler <daniel.kruegler@...glemail.com>, Kees Cook <keescook@...omium.org>, Valdis Klētnieks <valdis.kletnieks@...edu> Subject: Re: alx-0029r3 - Restore the traditional realloc(3) specification Florian Weimer wrote: > Wouldn't it be more consistent to move in the other direction, and > require that allocations of zero size fail because C does not support > zero-sized objects? This would be a terrible idea. In all programming domains, the special case of 0 needs to be specified in a way that most naturally extends the sequence of cases 1, 2, 3, ... If this is not done, application code must constantly have special code for 0, and since programmers are not good at doing this consistently, this would produce a large number of bugs. So, it is the task of the ISO C committee to *simplify* application programming by *integrating* the case of 0 smoothly with the cases 1, 2, 3, ... They are not entirely there yet, but the direction (e.g. of N3322) is the correct one. > int a[n]; > > is still undefined, and that C does not support zero-sized objects in > general? They are working on it; they are just not there yet. Bruno
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.