[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: clang memory sanitizer report unsigned int overflow
- From: bil til <biltil52@...>
- Date: Sat, 7 Jan 2023 06:47:37 +0100
Am Fr., 6. Jan. 2023 um 11:40 Uhr schrieb Lorenzo Donati
> Actually, rereading my own post and my C99 standard citation, you would
> need ints with at least 66 bits. Shifting out all the bits is UB.
(Just small side info: Controllers with non 2-exponent bit number make
no real sense, the CPU architecture would get just too cumbersome then
... the 2bit system of CPUs has the advantage, that the basic
calculation table consists only of 6 very simple logic operations
(AND/OR/XOR/NAND/NOR/XNOR) - therefore all is built around this "holy
2"... and CPUs learn multiply and add "in a snap" compared to humans
with their image brain, who need 4 years typically in elementary
school for the "10 number system basic calculation".
... 32bit reach already really high number range of 2-4Giga, and I am
quite sure that we still would work with 32bit CPUs in PCs, if not
around 2000 it became normal to get PCs with 2GB or 4GB RAM, and then
they HAD to switch to 64bit ... but I see no real reason why there
should be a switch to 128bit for commercial products in the next 200
years now... . (as I also expect that for 1-chip-microcontrollers with
ROM/RAM on board, the 32bit will be the dominiating CPU width for at
least further 50 years... )).