2 ms·
> E.g. modern C code tends to use "int" or "long" all over the place without considering if "short" or "char" is likely to be sufficient "Sufficient" is bit od
by zokier 12y ago
> E.g. modern C code tends to use "int" or "long" all over the place without considering if "short" or "char" is likely to be sufficient
"Sufficient" is bit odd choice of word here. Word-sized types should be used unless there is a good reason not to. See nkurzs comment for a great example for this:
> The first 'movl' wipes out any bits greater than 32 if they are there. This is because x was defined as an int, and not a long.
https://news.ycombinator.com/item?id=8346336 https://news.ycombinator.com/item?id=8346336