2 ms·
And why ADDR_SIZE squared? That just seems to work "by accident", since ADDR_SIZE is 4 it evaluates to 15. What is really meant is probably (1 << ADDR_SIZE), i.
by unwind 11y ago
And why ADDR_SIZE squared? That just seems to work "by accident", since ADDR_SIZE is 4 it evaluates to 15. What is really meant is probably (1 << ADDR_SIZE), i.e. 2 raised to ADDR_SIZE. Of course for the value 4 it evaluates to the same thing. For 5 it would become 24 rather than 31 which I would expect, assuming it's a size in bits of course ... Now I'm confused.
The file in question: https://github.com/gto76/comp-cpp/blob/e800d121e40f8acca6b9d0c4f2fe299fce012eee/src/const.hpp https://github.com/gto76/comp-cpp/blob/e800d121e40f8acca6b9d....
And the -1 seems to be explained by how the author wants to use it, it's "last valid address", i.e. not the size at all. Something I'd complain about if this were open for review, for sure. :)