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: <868qp1ra5f.fsf@linuxsc.com> <20250319115550.0000676f@yahoo.com> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> <20250320204642.0000423a@yahoo.com> <87iko3s3h2.fsf@nosuchdomain.example.com> <874izi82a4.fsf@nosuchdomain.example.com> 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 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