Article View: comp.lang.c
Article #691Re: Taming The Switch-Statement
From: Kaz Kylheku
Date: Fri, 23 Oct 2026 04:23
Date: Fri, 23 Oct 2026 04:23
37 lines
3034 bytes
3034 bytes
On 2026-10-22, Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > Kaz Kylheku <046-301-5902@kylheku.com> writes: > [...] >> These namespace declarations are really just a "heads up". POSIX >> isn't saying, don't have an identifier ending in _t in a namespace >> shared by typedefs. Rather, it is saying that new typedefs appearing >> in POSIX will be in that namespace. > [...] > > No, it says that all conforming applications are required to avoid > symbols ending in "_t". That concept is needed in order to make it the application's fault when it suddenly fails to build because it's using foo_t, and POSIX decides to introduced that into <sys/types.h>. If you use _t, a clash may happen, and if it does, then since POSIX told-you-so, it must be your program that is nonconforming, and not the POSIX has a defect or the implementation is nonconforming. > Of course you don't have to avoid defining symbols ending with "_t" > if you don't want to, but if you do so you don't have a "conforming > application" as far as POSIX is concerned. This is okay if you have a grip on the nonconformances in the application. You know where they are and have a way to be informed when they turn into real problems and a plan for that situation. Remember, a program that uses nullptr as a variable name was once conforming. Through no change in the program whatsoever, it became nonconforming. Playing the conformance game in this area is largely a fool's errand. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca
Technical Details
Message-ID:
<20261022211413.912@kylheku.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11b6224$2ejik$1@dont-email.me> <11b774o$2m8c9$3@dont-email.me> <11b7k22$2v8e5$1@dont-email.me> <11b8f5h$67l$1@reader2.panix.com> <11baah2$3te3v$1@dont-email.me> <11bb5ou$8nfg$2@dont-email.me> <11bcc4o$jt81$1@dont-email.me> <20261022094427.210@kylheku.com> <11be71q$1abv3$1@kst.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <046-301-5902@kylheku.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Fri, 23 Oct 2026 04:23:02 -0000 (UTC) Organization: A noiseless patient Spider Lines: 37 Message-ID: <20261022211413.912@kylheku.com> References: <119qf6l$2rmg3$1@dont-email.me> <11b6224$2ejik$1@dont-email.me> <11b774o$2m8c9$3@dont-email.me> <11b7k22$2v8e5$1@dont-email.me> <11b8f5h$67l$1@reader2.panix.com> <11baah2$3te3v$1@dont-email.me> <11bb5ou$8nfg$2@dont-email.me> <11bcc4o$jt81$1@dont-email.me> <20261022094427.210@kylheku.com> <11be71q$1abv3$1@kst.eternal-september.org> Injection-Date: Fri, 23 Oct 2026 04:23:04 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1547580"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UeFdliUnhUe8OuL/yyJ0MEoGKT69vV8c="; posting-host="2e9b00a2e58f1442ed4513cc7c5e8ae4" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:ASwU1T3PjrkQqzdObW/xMJthdYM= sha256:/OKpdua3LIhlfyEnVU2Gzyg7ICvgerljKDWiyrIHrKc= sha1:Q8H7r65tlKx8s1uoohuA0pprOv8= sha256:KQXV8pJ9ex14q+QJL9JPU06JtqcJFGroIF1zqdR1hDQ=