Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230524144906.GB4163@brightrain.aerifal.cx>
Date: Wed, 24 May 2023 10:49:06 -0400
From: Rich Felker <dalias@...c.org>
To: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
Cc: musl@...ts.openwall.com
Subject: Re: [C23 divers headers 16/17] C23: add the nullptr_t type

On Wed, May 24, 2023 at 04:42:53PM +0200, Jₑₙₛ Gustedt wrote:
> Rich,
> 
> on Wed, 24 May 2023 10:34:08 -0400 you (Rich Felker <dalias@...c.org>)
> wrote:
> 
> > On Wed, May 24, 2023 at 04:29:16PM +0200, Jₑₙₛ Gustedt wrote:
> > > Rich,
> > > 
> > > on Wed, 24 May 2023 10:22:01 -0400 you (Rich Felker
> > > <dalias@...c.org>) wrote:
> > >   
> > > > nullptr_t is not defined pre-C23 so the __clang__ branch
> > > > shouldn't be there.  
> > > 
> > > Well, if I do that, such a change is impossible to test, because
> > > there are not yet any compilers with that version number. How
> > > should we do that, then? Have a test for >= 201800L or so?  
> > 
> > I'm not really convinced this needs testing at this point (what even
> > is a test testing, if not that the right version results in the
> > definition being present?),
> 
> I have code that uses these things in `_Generic` to see if they do the
> intended choice. (I agree that this is more testing the compiler, than
> the library.)
> 
> > but what does existing -std=c2x or
> > whatever set the version to?
> 
> This depends on the compiler and its version. And some of these have
> `nullptr` and some don't.
> 
> > Could probably use >= that instead of >= the official C23 version.
> 
> I'll try to find a cut-off between the clang and gcc version macros.

One thought: For testing, you should be able to pass
-D__STDC_VERSION__=whatever to override it, no?

Rich

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.