This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55095] Wshift-overflow
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Oct 2012 18:39:39 +0000
- Subject: [Bug c++/55095] Wshift-overflow
- Auto-submitted: auto-generated
- References: <bug-55095-4@http.gcc.gnu.org/bugzilla/>
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)