Article View: muc.lists.netbsd.tech.kern
Article #59Re: Do all -current compilers support C23 typed enum syntax?
From: Thor Lancelot Simon
Date: Fri, 04 Dec 2026 19:51
Date: Fri, 04 Dec 2026 19:51
29 lines
3781 bytes
3781 bytes
On Thu, Dec 03, 2026 at 10:33:51PM -0800, Chris Hanson wrote: > On Dec 3, 2026, at 9:24???PM, Thor Lancelot Simon <tls@panix.com> wrote: > > > > On Thu, Dec 03, 2026 at 08:31:18PM -0800, Chris Hanson wrote: > >> > >> In general, this is not a fruitful line of discussion: Compilers do exist to serve their users, but those users have many different and competing needs, and optimization for both speed and size are among them. And the language specification is ultimately what defines ???broken??? when it comes to how to best meet those needs. > > > > I have been avoiding so far in this conversation noting that really, this > > all stems from Apple buying itself a 50 gallon drum of trouble by just begging > > for UB by using "enum" in ABI elements, but, this seems like the time to say > > it. > > You were right to avoid it, because I don???t think saying this advances the conversation at all. It presumes the people designing and implementing APIs and maintaining ABI compatibility at NeXT and Apple did not or do not know what they???re doing. To recount a little more history: NeXT and Apple *didn???t* originally use enum types directly in API precisely because of the problems they present for ABI stability in their C89 and C99 form. Instead, they followed the ???anonymous enum plus typedef of int??? model. > > To switch to using enum types directly in API after pursuing language features that make it safe to do so were explicit choices on Apple???s part. Those choices were driven by demand for better warnings & errors, better code completion, and a better symbolic debugging experience. I thought I'd understood you to have said that the use of the language feature, in C, on Apple's part, was driven by users who had actually experienced ABI incompatibilty by compiling their own code with -fshort-enum. If Apple didn't actually have enums in binary interfaces exposed to others' code _prior_ to the introduction of this language feature in C, I can't see how this would have been possible. But clearly I am missing some part of the picture. Thor -- 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:
<axMZ2R1wQ-NW8YMn@panix.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailReferences:
<> <C142AF44-C4BD-4852-9BA0-4F42213893A4@eschatologist.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail From: Thor Lancelot Simon <tls@panix.com> Newsgroups: muc.lists.netbsd.tech.kern Subject: Re: Do all -current compilers support C23 typed enum syntax? Date: Fri, 4 Dec 2026 14:51:53 -0500 Organization: Newsgate at muc.de e.V. Sender: tech-kern-owner@NetBSD.org Approved: news-admin@muc.de Distribution: world Message-ID: <axMZ2R1wQ-NW8YMn@panix.com> References: <> <C142AF44-C4BD-4852-9BA0-4F42213893A4@eschatologist.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="17788"; mail-complaints-to="news-admin@muc.de" Authentication-Results: mail.netbsd.org (amavisd-new); dkim=pass (1024-bit key) header.d=panix.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=panix.com; s=panix; t=1796413913; bh=yt/7J+15uPCypfWSmUws0PA9jjYh+GwaNTGU4qh+jLI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=jNT7qZ6tp6wJkui4wIcBu1c+SWSA/D1bKjCWf21btLN1ZjXOut79J879g8nJps0vj 5hZn2damWU6w+A+jECPe9hrs4FCzeezZm4NGkrsXVVPMog/G85BQhqjY+iSOsC5gzY YdBFD9x6zUkJYnZcVukAzLLMb4Hmm1GbZ6/CGC/8= Content-Disposition: inline In-Reply-To: <C142AF44-C4BD-4852-9BA0-4F42213893A4@eschatologist.net> Precedence: bulk X-Newsgate-Id: f02c70b8849f+ X-No-Archive: Yes