Article View: muc.lists.netbsd.tech.kern
Article #49Re: Do all -current compilers support C23 typed enum syntax?
From: Mouse
Date: Fri, 04 Dec 2026 03:54
Date: Fri, 04 Dec 2026 03:54
24 lines
2332 bytes
2332 bytes
> The compiler, being very clever, sees that all enumerated values of
> enum cmd have been covered by the switch, so it helpfully deletes
> some code it can _prove_ is dead -- this part:
> default:
> panic("unknown command");
Such a compiler is broken, and I would not hesitate to file a bug
report against it, if only because nothing prevents recv_cmd from
returning a cmd whose .name contains a value other than one of the enum
constants, meaning that code is *not* dead.
More generally, compilers exist to serve their users, not to
straitjacket them. If the coder has to work around the compiler, the
compiler is broken, regardless of what specs it might conform to.
/~\ 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:
<202612040354.WAA28170@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:
<20261204030713.17DC084DF1@mail.netbsd.org>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: Thu, 3 Dec 2026 22:54:08 -0500 (EST) Organization: Newsgate at muc.de e.V. Sender: tech-kern-owner@NetBSD.org Approved: news-admin@muc.de Distribution: world Message-ID: <202612040354.WAA28170@Stone.Rodents-Montreal.ORG> References: <20261204030713.17DC084DF1@mail.netbsd.org> 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="24875"; 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: Thu, 3 Dec 2026 22:48:04 -0500 (EST) In-Reply-To: <20261204030713.17DC084DF1@mail.netbsd.org> Precedence: bulk X-Newsgate-Id: f02c70b8849f+ X-No-Archive: Yes