Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Top 10 most common hard skills listed on resumes... Date: Mon, 09 Sep 2024 13:16:53 -0700 Organization: None to speak of Lines: 51 Message-ID: <87v7z41t1m.fsf@nosuchdomain.example.com> References: <878qw13a40.fsf@nosuchdomain.example.com> <874j6p34df.fsf@nosuchdomain.example.com> <20240909114553.226@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 09 Sep 2024 22:16:54 +0200 (CEST) Injection-Info: dont-email.me; posting-host="5130c977fa34ae7ba7f2b29594baf74a"; logging-data="2647568"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+05kqj2xpLuepUPIcRO43" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:87teF+R2DvYuxIvcD3wHb2IzdSo= sha1:9R9SnRNhaHPW2Bxm7T18cMcN7B8= Bytes: 3290 David Brown writes: > On 09/09/2024 20:46, Kaz Kylheku wrote: >> On 2024-09-09, David Brown wrote: >>> On 09/09/2024 18:57, Bart wrote: >>>> On 09/09/2024 17:21, Waldek Hebisch wrote: >>>>> Keith Thompson wrote: >>>> >>>>>> C23 doesn't add any new support for 128-bit integers. >>>> >>>> So what does _Bitint do with a width of 128 bits? >>>> >>> >>> _BitInt types are not "integer types". Nor is gcc's __int128 type. >> How can we write a program which, in an implementation which has a >> __int128 type, outputs "yes" if it is an integer type, otherwise "no"? I'm not sure such a program, one that can detect either an __int128 that isn't an integer type or an __int128 that is an integer type, is possible. > #include > > int main() { > auto const x = 0x1'0000'0000'0000'0000; > if (x > 0xffff'ffff'ffff'ffff) { > printf("yes\n"); > } else { > printf("no\n"); > } > } Of course this uses digit separators, which are a new feature in C23. If an implementation doesn't have an integer type wider than 64 bits, then the constant 0x1'0000'0000'0000'0000 has no type, which violates a constraint. If an implementation does have a integer types wider than 64 bits, there's no guarantee that it uses the name "__int128". A future gcc might have a 128-bit (extended) integer type and still have __int128 with its current semantics. For gcc, this meets Kaz's specification: #include int main(void) { puts("no"); } -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */