int64_t compiler warning

Hi, all -

Any idea why this code:

1
2
#include <tr1/cstdint>
const	int64_t	BIT_55 = 0x1 << 55;


Would generate a compiler error "warning: left shift count >= width of type?"

For what it's worth, it generates the same error if I try to shift beyond bit 32. Am I not indeed getting a 64-bit data type here, or perhaps the << operator wasn't properly overloaded?

Thanks for any clarification.
the compiler is probably treating 0x1 as an int, and not as an int64_t

Try this:

 
const	int64_t	BIT_55 = 0x1LL << 55;  // note:  0x1LL 

Hi, Disch –

That compiled OK. What exactly does the LL do: does that guarantee a 64-bit datum, or is it compiler-dependent?
Topic archived. No new replies allowed.