Article View: comp.lang.c
Article #699Re: Taming The Switch-Statement
From: Keith Thompson
Date: Fri, 23 Oct 2026 08:09
Date: Fri, 23 Oct 2026 08:09
40 lines
3293 bytes
3293 bytes
Kaz Kylheku <046-301-5902@kylheku.com> writes:
> 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.
Yes, I understand all that. I was commenting on what POSIX actually
says.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID:
<11bf4o1$1jgpe$1@kst.eternal-september.org>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!kst.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> <20261022211413.912@kylheku.com>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!kst.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Fri, 23 Oct 2026 01:09:31 -0700 Organization: None to speak of Lines: 40 Message-ID: <11bf4o1$1jgpe$1@kst.eternal-september.org> 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> <20261022211413.912@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 23 Oct 2026 08:09:38 +0000 (UTC) Injection-Info: kst.eternal-september.org; logging-data="1688366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dOrEe8K8SGSL6R3nWJVR7"; posting-host="f440da176685714721ec135546110242" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:6NPP6qm7JZxTCzLYEqq9mQQO9Uc= sha256:4+uJ4slGznx932HuE2a+/jplfrU8ROlArh4CentAZJM= sha1:MEsAJ5AYYFrnoDO/WVC+i7ptmWw= sha256:R+sgsoYiuZqKB5Y2hAqA4CwyRh6t4cJyvbVK5ob8TwQ=