The following code triggers a gcc warning (gcc 4.2.1):
#include <boost/cstdint.hpp>
boost::uint64_t x = 1 << 32; // warning: left shift count >= width of type
Shouldn’t it be fine since the type has 64 bits?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your compiler supports
long long:Otherwise:
No. Even though
xis 64 bits,1isn’t.1is 32 bits. How you use a result has no effect on how that result is generated.