Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lb4cnscy5ftoxegnxzyeuceh7js2vi3nxqm5lx76jvj2ekuupl@lw7jtghjyfqy>
Date: Thu, 19 Jun 2025 15:11:36 +0200
From: Alejandro Colomar <alx@...nel.org>
To: Rich Felker <dalias@...c.org>
Cc: Vincent Lefevre <vincent@...c17.net>, linux-man@...r.kernel.org, 
	musl@...ts.openwall.com, libc-alpha@...rceware.org, Paul Eggert <eggert@...ucla.edu>, 
	Bruno Haible <bruno@...sp.org>, bug-gnulib@....org
Subject: Re: malloc.3: Clarify realloc(3) standards conformance

Hi Rich,

On Thu, Jun 19, 2025 at 09:04:51AM -0400, Rich Felker wrote:
> > > n?:1 is a GNU extension:
> > > 
> > > warning: ISO C forbids omitting the middle term of a ‘?:’ expression [-Wpedantic]
> > > 
> > > with gcc -pedantic -std=c23, and such code should not be given in
> > > examples (as a workaround should still be valid for portable code).
> > 
> > Hmmm, I guess I can write it as n?n:1.
> > 
> > I'll write a proposal to standardize ?: in ISO C too.
> 
> That still doesn't make it appropriate to recommend in a man page for
> people who will be writing code mostly to non bleeding edge (some even
> C89) versions of the standard.
> 
> Examples and proscriptions should be minimally fancy, not using new or
> clever things unnecessarily in ways that could break or just not
> immediately be understood by the reader.

Yep, I meant that as a side note to address the fact that this is non-
standard.

I've changed this patch to use n?n:1 as said above.


Have a lovely day!
Alex

> 
> Rich
> 

-- 
<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.