osdir.com
mailing list archive

Subject: Re: unsigned long long int ???? - msg#00182

List: gcc.help

Date: Prev Next Index Thread: Prev Next Index
>>>>> "Suni" == Suni B Bongale <sbongale@xxxxxxxxxxxxx> writes:

Suni> The version number of the gcc that I am using is gcc version
Suni> 2.95.4 I have written a macro in the follwing source code to
Suni> retrieve a unsigned long long value form a character array
Suni> But when I compiled the code its giving error.

It's giving errors because of unbalanced parenthesis. You have more
opening parenthesis than closing ones in your macro definition.

You should really use an editor which shows you the extent of your
parens (Emacs is good ;-).

I suppose what you wanted was something like:

#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)))))

--
Claudio Bley _
ASCII ribbon campaign ( )
ICQ# 83197241 - against HTML email X
http://www.cs.uni-magdeburg.de/~bley/ & vCards / \



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Compilation Errors

Hi All, I hitting some compilation errors while compiling a .cpp file. I am using gcc 3.1 on Red Hat 7.2 (32 bit m/c). The errors says something like; In file included from /usr/gcc31/include/g++-v3/bits/fpos.h:45, from /usr/gcc31/include/g++-v3/iosfwd:46, from /usr/gcc31/include/g++-v3/streambuf:46, from /usr/gcc31/include/g++-v3/backward/streambuf.h:32, from chatdoc.cpp:14: /usr/gcc31/include/g++-v3/cwchar:142: `fwide' not declared /usr/gcc31/include/g++-v3/cwchar:145: `getwc' not declared /usr/gcc31/include/g++-v3/cwchar:146: `getwchar' not declared /usr/gcc31/include/g++-v3/cwchar:149: `mbsinit' not declared /usr/gcc31/include/g++-v3/cwchar:152: `putwchar' not declared /usr/gcc31/include/g++-v3/cwchar:157: `vfwscanf' not declared /usr/gcc31/include/g++-v3/cwchar:159: `vswscanf' not declared /usr/gcc31/include/g++-v3/cwchar:161: `vwscanf' not declared /usr/gcc31/include/g++-v3/cwchar:176: `wcstof' not declared /usr/gcc31/include/g++-v3/cwchar:182: `wmemcmp' not declared /usr/gcc31/include/g++-v3/cwchar:183: `wmemcpy' not declared /usr/gcc31/include/g++-v3/cwchar:184: `wmemmove' not declared /usr/gcc31/include/g++-v3/cwchar:185: `wmemset' not declared Anything wrong with my gcc installtion?. Looking at these errors I guess there is nothing wrong with souce file which I am compiling. Any idea how to solve this? Thanks -VN

Next Message by Date: click to view message preview

Re: GCJ 3.1.1 targeting Windows (preferably with mingw32)

Hello, I have written this mail in order to demand, if someone can help me. In fact, i am a newbee in GCC. I am trying to get a built version of GCJ that runs and targets Windows (preferably with MingW). I was wondering wether I could get a copy of someone's build or some detailed direction for build of GCJ. I am usually a user of Microsoft Visual Studio tools (C++, J, ...) Thanks for help. Tabaqui _________________________________________________________________ Discutez en ligne avec vos amis ! http://messenger.msn.fr

Previous Message by Thread: click to view message preview

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

Next Message by Thread: click to view message preview

Compilation Errors

Hi All, I hitting some compilation errors while compiling a .cpp file. I am using gcc 3.1 on Red Hat 7.2 (32 bit m/c). The errors says something like; In file included from /usr/gcc31/include/g++-v3/bits/fpos.h:45, from /usr/gcc31/include/g++-v3/iosfwd:46, from /usr/gcc31/include/g++-v3/streambuf:46, from /usr/gcc31/include/g++-v3/backward/streambuf.h:32, from chatdoc.cpp:14: /usr/gcc31/include/g++-v3/cwchar:142: `fwide' not declared /usr/gcc31/include/g++-v3/cwchar:145: `getwc' not declared /usr/gcc31/include/g++-v3/cwchar:146: `getwchar' not declared /usr/gcc31/include/g++-v3/cwchar:149: `mbsinit' not declared /usr/gcc31/include/g++-v3/cwchar:152: `putwchar' not declared /usr/gcc31/include/g++-v3/cwchar:157: `vfwscanf' not declared /usr/gcc31/include/g++-v3/cwchar:159: `vswscanf' not declared /usr/gcc31/include/g++-v3/cwchar:161: `vwscanf' not declared /usr/gcc31/include/g++-v3/cwchar:176: `wcstof' not declared /usr/gcc31/include/g++-v3/cwchar:182: `wmemcmp' not declared /usr/gcc31/include/g++-v3/cwchar:183: `wmemcpy' not declared /usr/gcc31/include/g++-v3/cwchar:184: `wmemmove' not declared /usr/gcc31/include/g++-v3/cwchar:185: `wmemset' not declared Anything wrong with my gcc installtion?. Looking at these errors I guess there is nothing wrong with souce file which I am compiling. Any idea how to solve this? Thanks -VN
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by