Deutsch   English   Français   Italiano  
<20250325092315.416@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.lang.c
Subject: Re: The integral type 'byte' (was Re: Suggested method for
 returning a string from a C program?)
Date: Tue, 25 Mar 2025 16:31:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <20250325092315.416@kylheku.com>
References: <vrd77d$3nvtf$2@dont-email.me> <868qp1ra5f.fsf@linuxsc.com>
 <vrdhok$47cb$2@dont-email.me> <20250319115550.0000676f@yahoo.com>
 <vreuj1$1asii$4@dont-email.me> <vreve4$19klp$2@dont-email.me>
 <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com>
 <vrh1br$35029$2@dont-email.me> <LRUCP.2$541.0@fx47.iad>
 <vrh71t$3be42$1@dont-email.me> <vrh9vh$3ev9o$1@dont-email.me>
 <vrhct4$3frk8$2@dont-email.me> <20250320204642.0000423a@yahoo.com>
 <vrhphb$3s62l$1@dont-email.me> <87iko3s3h2.fsf@nosuchdomain.example.com>
 <vrrvgp$1828d$1@dont-email.me> <874izi82a4.fsf@nosuchdomain.example.com>
 <vrttin$321rm$1@dont-email.me>
Injection-Date: Tue, 25 Mar 2025 17:31:46 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d3381b38f55d771d9a1d3766a5267560";
	logging-data="3872721"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/W7XQczmxdVMnOED2OogEElVWlyeRBUhI="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Q2vL1xZ/UthN+TETDGaYC0ODRq4=
Bytes: 2433

On 2025-03-25, David Brown <david.brown@hesbynett.no> wrote:
> Personally, I think "typedef uint8_t byte;" /is/ ideal - and much better 
> than "typedef unsigned char byte;" would be.  I say that as someone who 
> works in a field with bits and bytes more than ints and doubles.

The problem is that uint8_t is not endowed with the special
aliasing rules for accessing objects of other types as arrays
of unsigned char. A type called byte is prone to precipitating
into those uses.

A platform like Arduino could assert that in their toolchain,
the type byte does have those properties (and then somehow ensure
that is true, in spite of it being uint8_t, like by patching
the compiler if they have to).

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca