On 2022-01-21 8:40 a.m., Alexander Bluhm wrote: >>> There is no best, minimalistic and most consistent solution. >> >> I have always considered numberU as being the same type of thing as >> using 'u_int' instead of 'int' for a variable, it is idiomatic C >> to force all considerations into signed. >> >> If our system header files had 4000 lines with U, how many bugs >> would get fixed incidentaly? >> >> It is a strong idiom. A sad idiom, perhaps. It wasn't needed in >> historic C, a compiler would always generate the correct code, but >> here we are. > > Sounds like a call for the huge U change. I've been curious about this for a long time; Would using const uint16_t or uint32_t instead of proprocessor defines also make sense anyway if the purpose is to stop the compiler from being mysterious with implicit data types? I've never seen a compelling reason to use defines when const variables get a degree of type protection and misuse gets caught by the compiler much more quickly.
-- Ted Bullock <[email protected]>
