🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #682

Re: Taming The Switch-Statement

#682
From: David Brown
Date: Thu, 22 Oct 2026 19:09
47 lines
3637 bytes
On 22/10/2026 18:54, Kaz Kylheku wrote:
> On 2026-10-22, David Brown <david.brown@hesbynett.no> wrote:
>> On 21/10/2026 22:02, Chris M. Thomasson wrote:
>>> On 10/21/2026 5:17 AM, David Brown wrote:
>>> [...]
>>>
>>> *_t intrudes into POSIX.
>>
>> I don't program for POSIX, so I don't care.  The same applies to most
>> code that is used in connection with FreeRTOS, or LWIP.  (Of course
>> there will be some overlap - bits of code that are intended to run on a
>> microcontroller but tested with code running native on a PC.)
>>
>> I don't know if the "_t" convention for type identifiers started with
>> POSIX, but it has certainly far outgrown POSIX.  And I think the smart
>> folks behind POSIX know this, and will not assume that just because they
>> pick a new type name ending in _t, it will not conflict with some user
>> code.  As C doesn't have namespaces, there is always a risk of
>> conflicting names - you just have to try to avoid clashes in things you
>> are likely to see.
> 
> 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.
> 
> Consider this argument: whenever POSIX or ISO C introduces a new
> public identifier, it's necessarily going to start with "a", or else if
> not, then with "b", or else with "c", ... or else with "z"
> or perhaps the underscore.
> 
> That doesn't mean you stop using identifiers in programming.
> 
> "nullptr" is now a keyword, previously a valid identifier not in
> any proclaimed reserved namespace. Progrems which used it have
> to be changed to work with the newer language.
> 
> Avoiding proclaimed namespaces will not protect you from clashes;
> only from clashes that would occur in those namespaces.
> 
> Some spaces like _t are too attractive to avoid, because they are tied
> to an important, popular convention that everyone understands,
> and the benefits outweigh the unrealized risk of a future clash.
> 

I agree entirely.
Technical Details
Message-ID: <11bdn1j$14p5v$1@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-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!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Thu, 22 Oct 2026 21:09:39 +0200
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <11bdn1j$14p5v$1@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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 22 Oct 2026 19:09:40 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1205439"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/5ABqIZ4EGoMkQn9O9H6gvD+ArkebpaE8="; posting-host="2f8d23f3daf5dbc8aaf1ed14c9b6876a"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dB6h+tjwJTyT6kPUPwACXJPBkMQ= sha256:qQ3RSZ6W4aHySROTkJnORj6/ys1Uov99fgVRyr7mnQE=
	sha1:deDi+X4EwOUK6uzu1Hm+xyFU1oA= sha256:b+ZTfLsn07KxOeVMF8YtPhJuXmp/C62OQdsZ1PWnC6M=
In-Reply-To: <20261022094427.210@kylheku.com>
Content-Language: en-GB