This is the mail archive of the gcc-help@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]

Re: Warning with 64-Bit datatype


Hi Michael,

Try using <stdint.h> types instead:

#include <stdint.h>
int64_t hash;
hash = (hash << 1) & INT64_MAX;

--or--

#include <stdint.h>
int64_t hash;
hash = (hash << 1) & INT64_C(0x7FFFFFFFFFFFFFFF);

HTH,
--Eljay


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