On Sunday, March 30, 2025, Thiago Macieira wrote:
On Saturday, 29 March 2025 17:04:46 Eastern Daylight Time Jonathan Wakely wrote:
> On what platform in existence today does a type that's at least 32 bits
> promote?
None. It would need to be a platform with an int probably of 64 bits, which
doesn't exist.
I'm currently writing a fully-portable (C++14) implementation of MD5 constexpr, in order to make a single-header-only library to generate UUID's at compile time. I'm testing it on 27 cross-compilers, both big endian and little endian, as well as on my trusty Texas Instruments microcontroller that has a 16-Bit char and a 16-Bit int.
CHAR_BIT == 16 && 1==sizeof(short)==sizeof(int)
Also I'm accommodating one's complement and sign magnitude (even though C++20 has outlawed them).
Another thing I'm accommodating is:
CHAR_BIT==64 && sizeof(short)==sizeof(long long)
So anyway my code looks a little ridiculous in places as I'm super-paranoid about stuff such as a 32-Bit unsigned int promoting to a 64-Bit signed int.