Article View: comp.lang.c
Article #690Re: Taming The Switch-Statement
From: Blaine
Date: Fri, 23 Oct 2026 00:38
Date: Fri, 23 Oct 2026 00:38
44 lines
3517 bytes
3517 bytes
Keith Thompson 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". > > https://pubs.opengroup.org/onlinepubs/9799919799/xrat/V4_xsh_chap01.html > B.2.11.1 Defined Types > > The requirement that additional types defined in this section > end in "_t" was prompted by the problem of name space pollution. > It is difficult to define a type (where that type is not one > defined by POSIX.1-2024) in one header file and use it in another > without adding symbols to the name space of the program. To > allow implementors to provide their own types, all conforming > applications are required to avoid symbols ending in "_t", > which permits the implementor to provide additional types. > Because a major use of types is in the definition of structure > members, which can (and in many cases must) be added to the > structures defined in POSIX.1-2024, the need for additional > types is compelling. > > 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. > > It is, of course, an imperfect solution. > Aside from having to type 'break' for each 'case', do you have a legitimate case? -- Can you strip away so we may start again? "Thereโs a switch and they don't seem authentic or themselves. It feels like Iโm an unnecessary body and itโs a waste of time to even be there." -- Grim, playful Blaine.
Technical Details
Message-ID:
<11bea9m$1bk84$2@dont-email.me>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: Blaine <cactus_DAC@yahoo.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Thu, 22 Oct 2026 18:38:11 -0600 Organization: A noiseless patient Spider Lines: 44 Message-ID: <11bea9m$1bk84$2@dont-email.me> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 23 Oct 2026 00:38:17 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1429764"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hMyzvYSNABsPk2CNphLGewW+AwWxX+o0="; posting-host="110c3af15af5381287e9e9119f52afaa" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:l36bfRNpp6a/C7hL1KW5gfkMcG4= sha256:Qr0w+4F1p/pIDe0Eq6eo7dGO1C0mhNSvGxxDBNSfXrE= sha1:GfBEnOTFpCeT7Xh9aFh8ft42jeo= sha256:D9PJf/AavBNYO62Gvbwu0qezx0GgMwNA8kn71MZP994= In-Reply-To: <11be71q$1abv3$1@kst.eternal-september.org>