unsigned long long int ????
Suni B. Bongale
sbongale@nulinkinc.com
Tue Aug 20 23:23:00 GMT 2002
The version number of the gcc that I am using is gcc version 2.95.4
I have written a macro in the follwing source code to retrieve a
unsigned long long value form a character array
But when I compiled the code its giving error.
#include <stdio.h>
typedef unsigned long long U64bit;
#define GTP_GET_U64BIT(p_buff) (unsigned long long)\
((U64bit)((*(p_buff)) << 56) | (U64bit)((*(p_buff + 1)) << 48)
| \
((U64bit)((*(p_buff +2)) << 40) | (U64bit)((*(p_buff + 3)) <<
32) | \
((U64bit)((*(p_buff +4)) << 24) | (U64bit)((*(p_buff + 5)) <<
16) | \
(U64bit)((*(p_buff + 6)) << 8) | (U64bit)(*(p_buff + 7)))
main()
{
unsigned char imsi[9] = {255,255,255,255,255,255,255,255,255};
unsigned long long b;
b = GTP_GET_U64BIT(&imsi[0]);
printf("%ul",b);
}
test1.c: In function `main':
test1.c:15: warning: left shift count >= width of type
test1.c:15: warning: left shift count >= width of type
test1.c:15: warning: left shift count >= width of type
test1.c:15: warning: left shift count >= width of type
test1.c:15: parse error before `;
Thanks for any help!
Regards
Sunil Bongale
More information about the Gcc-help
mailing list