Article View: muc.lists.netbsd.tech.kern
Article #54Re: Do all -current compilers support C23 typed enum syntax?
From: Mouse
Date: Fri, 04 Dec 2026 14:07
Date: Fri, 04 Dec 2026 14:07
34 lines
2687 bytes
2687 bytes
> Using enum in a binary interface to other people's code bespeaks > profound misunderstanding of the limitations of C and papering over > it afterwards is bound to be fraught. It seems to me that this is the difference between the ABI being this value has type int and value 1 means <foo> and this value has type enum XYZ_OPT and the value XYZ_FOO means <foo> and there really isn't much difference there; it feels a bit dodgy to me (largely because I try to think of enums more abstractly) but, really, the language spec defines what the values are quite clearly, given the enum declaration - and the enum declaration is, conceptually, no different from the list of #defines used by the int-and-#defines alternative. It's true that the in-memory size of the enum type isn't specified by the language, but then, neither is the size of int. In either case, compiler flags or new implementations may change it, and that's been true for a very long time (since the days of "ANSI C", at least). So, I actually think I disagree with tls here. /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML mouse@rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<202612041407.JAA05577@Stone.Rodents-Montreal.ORG>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<> <axJOpU_bzJC_LUSU@panix.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail From: Mouse <mouse@Rodents-Montreal.ORG> Newsgroups: muc.lists.netbsd.tech.kern Subject: Re: Do all -current compilers support C23 typed enum syntax? Date: Fri, 4 Dec 2026 09:07:58 -0500 (EST) Organization: Newsgate at muc.de e.V. Sender: tech-kern-owner@NetBSD.org Approved: news-admin@muc.de Distribution: world Message-ID: <202612041407.JAA05577@Stone.Rodents-Montreal.ORG> References: <> <axJOpU_bzJC_LUSU@panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="74555"; mail-complaints-to="news-admin@muc.de" X-Erik-Conspiracy: There is no Conspiracy - and if there were I wouldn't be part of it anyway. X-Message-Flag: Microsoft: the company who gave us the botnet zombies. X-Composition-Start-Date: Fri, 4 Dec 2026 08:11:07 -0500 (EST) In-Reply-To: <axJOpU_bzJC_LUSU@panix.com> Precedence: bulk X-Newsgate-Id: f02c70b8849f+ X-No-Archive: Yes