This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55095] Wshift-overflow


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55095

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-27 18:39:39 UTC ---
(In reply to comment #1)
> Is there any function to compute how many bits are required to store a value?

For positive values it's easy, something like   1 + (int)log2(value)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]