Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.std.c Subject: Re: bit-fields of type unsigned long and unsigned long long Date: Wed, 23 Jun 2021 16:12:11 -0700 Organization: None to speak of Lines: 38 Message-ID: <87im24w4z8.fsf@nosuchdomain.example.com> References: <8735t9yda4.fsf@nosuchdomain.example.com> <87pmwcwl6l.fsf@nosuchdomain.example.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="70e67a5c90413ba34e7665d352b91ebe"; logging-data="15410"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QxJBtq2bAU16BNzrT3CAq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:Y9cWIHQRGBQmBfdBt11Yur72Hes= sha1:XSbn435ySTEelS8nyKJ80rRbpZ4= Xref: csiph.com comp.std.c:6238 Philipp Klaus Krause writes: > Am 23.06.21 um 19:22 schrieb Keith Thompson: >> Philipp Klaus Krause writes: >>>> Given that no compiler (to my knowledge - and I'd be very interested in >>>> counter-examples) actually has extended integer types, that is surely >>>> not a problem. >>> >>> I think they are mostly used in lesser-known compilers targeting >>> embedded systems; but AFAIK both GCC and clang have a 24-bit extended >>> integer type when targeting avr, also used as int24_t and uint24_t in >>> stdint.h. >> >> gcc's documentation says "GCC does not support any extended integer types.". >> I don't see anything about 24-bit integers. >> >> [...] > > Hmm, https://gcc.gnu.org/wiki/avr-gcc mentions 24-bit integers. Maybe > they are 24-bit integers not considered extended integer types in the > sense of the standard? Though I don't know what they'd do that; AFAIK > that only makes sense if you want something that behaves like an integer > bigger than intmax_t. Interesting. It does mention __int24 and __uint24 under "Extensions", so apparently they're language extensions (allowed under 4p6) rather than extended integer types. Perhaps they don't meet all the requirements of (extended) integer types. Since the compiler appears not to be fully conforming anyway, I'm not sure how much that matters (except that it would have given us an example of extended integer types in the wild). Similarly, gcc supports __int128 and unsigned __int128 (note the different syntax) as a language extension on some target systems. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */