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]

unsigned long long int ????


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
 


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