🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #689

Re: Taming The Switch-Statement

#689
From: Keith Thompson
Date: Thu, 22 Oct 2026 23:42
36 lines
3039 bytes
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.

-- 
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: <11be71q$1abv3$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-mail
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>

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: Thu, 22 Oct 2026 16:42:50 -0700
Organization: None to speak of
Lines: 36
Message-ID: <11be71q$1abv3$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>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Thu, 22 Oct 2026 23:42:51 +0000 (UTC)
Injection-Info: kst.eternal-september.org;
	logging-data="1388515"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19mP2gx8vl/z5rVss2XTQsz"; posting-host="b73152489b40f013ef73863d29f669ac"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:3OBPG80xxxtUpiT7B27JIWTvtpM= sha256:vxjSadrgc0i3UfqEujm1sP63ivqX8243gjGVJhICNCw=
	sha1:YQ2Xog8Q2RvMUmXQ4Na+p3Ow1Hw= sha256:r9uW6sm4jHLzM89+GjrtvvP9qQNBNIidNEFd6iqkXzE=