From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21263 invoked from network); 24 May 2023 14:31:12 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 24 May 2023 14:31:12 -0000 Received: (qmail 16157 invoked by uid 550); 24 May 2023 14:30:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 16090 invoked from network); 24 May 2023 14:30:38 -0000 Date: Wed, 24 May 2023 10:30:26 -0400 From: Rich Felker To: =?utf-8?B?SuKCkeKCmeKCmw==?= Gustedt Cc: musl@lists.openwall.com Message-ID: <20230524143025.GZ4163@brightrain.aerifal.cx> References: <20230524142103.GV4163@brightrain.aerifal.cx> <20230524162643.584eea6e@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230524162643.584eea6e@inria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [C23 divers headers 15/17] C23: add the unreachable macro On Wed, May 24, 2023 at 04:26:43PM +0200, Jā‚‘ā‚™ā‚› Gustedt wrote: > Rich, > > on Wed, 24 May 2023 10:21:05 -0400 you (Rich Felker ) > wrote: > > > On Wed, Apr 19, 2023 at 08:38:04AM +0200, Jens Gustedt wrote: > > > --- > > > include/stddef.h | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/include/stddef.h b/include/stddef.h > > > index f25b8639..09be5fb6 100644 > > > --- a/include/stddef.h > > > +++ b/include/stddef.h > > > @@ -24,4 +24,6 @@ > > > #define offsetof(type, member) ((size_t)( (char *)&(((type > > > *)0)->member) - (char *)0 )) #endif > > > > > > +#define unreachable() __builtin_unreachable() > > > + > > > #endif > > > -- > > > 2.34.1 > > > > This is a namespace violation unless protected by a C version check. > > That would have been my first take also. I changed these things after > you (I think it was you) telling me that generally interfaces that are > added in newer versions of C need not be protected for older > version. I probably misunderstood something. Can you please clarify > under which circumstances you want feature tests and when not? OK, I agree it's a little bit unclear, but here it's a case of a very minimalist header (stddef.h) defining a new, plain-english-word macro that's very likely to conflict with existing code. I'm not sure where exactly the cutoff point for whether it matters should be -- this is something community should probably discuss. But I think this is a really clear case where the namespace should not be stomped. Cases where it's almost surely OK, OTOH, are things like promoting common existing functions to standard -- existing code is almost surely already avoiding conflicts with these (e.g. the time.h stuff). Rich