I did really have int128 literal support in clang for a while, under the bogus "Microsoft extension" suffix [u]i128 (which doesn't actually exist in any Microsoft compiler, but the parser was there). It's been removed though =/
-
-
Replying to @stephentyrone @cr88192 and
There are likely all sorts of problems with doing it, like how it behaves in
#if...1 reply 0 retweets 0 likes -
Replying to @RichFelker @cr88192 and
It worked great! The only major issue was the formal semantics issues around extended types and intmax, as you sketched out.
2 replies 0 retweets 1 like -
Replying to @stephentyrone @cr88192 and
But preprocessor requires all arithmetic take place in a common signed or unsigned type matching [u]intmax_t...
1 reply 0 retweets 0 likes -
Replying to @RichFelker @cr88192 and
As I said, the only real issue is around intmax.
1 reply 0 retweets 0 likes -
Replying to @stephentyrone @cr88192 and
Even without stdint.h and intmax_t, though, you'd run into the same problem with consistently defining what's supposed to happen at the preprocessor level...
1 reply 0 retweets 0 likes -
Replying to @RichFelker @cr88192 and
Yes. It breaks a whole mess of formal rules, but almost no real code is affected.
1 reply 0 retweets 0 likes -
Replying to @stephentyrone @cr88192 and
Clearly some of us do more awful things with the preprocessor than others... ;-)
2 replies 0 retweets 3 likes -
Replying to @RichFelker @cr88192 and
I inserted the "almost" just for you.
2 replies 0 retweets 3 likes -
Replying to @stephentyrone @RichFelker and
I may be missing something, but is there a reason than intmax_t can't be defined as being __int128 or similar?... (excluding maybe linkage issues with existing binaries or similar)
1 reply 0 retweets 0 likes
That's the issue -- every time you add a new extended integer type, you'd have to replace the ABI with a new one where intmax_t is defined differently. Non-extensible.
-
-
Replying to @RichFelker @stephentyrone and
OK. Since my case is still pretty open-ended, went and updated the stdint.h stuff (for the C lib I am using) to use int128 as the maximum. I guess this leaves it as an issue for what happens if an __int256 type is added at some point.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.