Path: news.eternal-september.org!eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Sun, 15 Jun 2025 09:32:39 +0200 Organization: A noiseless patient Spider Lines: 29 Message-ID: <102lsum$pcap$1@raubtier-asyl.eternal-september.org> References: <86plggzilx.fsf@linuxsc.com> <86ldr4yx0x.fsf@linuxsc.com> <1000cs3$2234m$1@dont-email.me> <87sel8nqid.fsf@nosuchdomain.example.com> <20250513202557.281@kylheku.com> <87o6vvbxmp.fsf@nosuchdomain.example.com> <86jz5jrbrz.fsf@linuxsc.com> <102jikt$4hdj$1@raubtier-asyl.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 15 Jun 2025 09:32:38 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="f7ff19f6dadb7c41a76e0d3a960f3a0b"; logging-data="831833"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tFnvDe1MY3sNJ8RTDba8g4dkeJqNyXd4=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:xlFV2mlhJZwTxFYSkFOcHAwIC3k= Content-Language: de-DE In-Reply-To: Am 14.06.2025 um 15:57 schrieb Scott Lurndal: > Bonita Montero writes: >> Am 10.06.2025 um 15:01 schrieb Tim Rentsch: >> >>> Consider the following program: >>> >>> #include >>> #include >>> >>> typedef unsigned long long ULL; >>> ULL hello = ((((0ULL +'o' <<8) +'l' <<8) +'l' <<8) +'e' <<8) + 'h'; >>> >>> int >>> main(){ >>> printf( "length is %zu\n", strlen( (char*)&hello ) ); >>> return 0; >>> } >>> >>> On a little endian machine (with CHAR_BIT == 8) this program works, >>> and TTBOMK conforms to both the letter and the spirit of the C >>> standard, without any undefined behavior (on that platform). Yet >>> there are no arrays in sight, and certainly no array objects. >> >> There are not much remaining big-endian architectures today. > > Ethernet is big-endian at the byte level and little-endian > at the bit level. However, little-endian is simply the smarter concept.