[Bug c++/92659] Suggestions for bitshift

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 26 15:27:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92659

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Xi Ruoyao from comment #3)
> I can't find any specification in C standard saying "the bitwidth of long
> should >= the bitwidth of size_t".  So at least theoretically it may be
> insufficient.

Right. Also size_t itself might only be 32 bits, so (size_t) 1 << 32 is no
better than 1 << 32.

I don't think this suggestion is a good idea.


More information about the Gcc-bugs mailing list