LLONG_MAX

bridged with qdn.public.qnxrtp.x86
Post Reply
Oleksandr Brovko

LLONG_MAX

Post by Oleksandr Brovko » Mon Nov 25, 2002 2:16 pm

All,

Could somebody explain me why this does not compile?
----lim.cpp-------
#include <climits>
void main()
{
long long i = LLONG_MAX;
}

getting following error:
lim.cpp: In function `int main(...)':
lim.cpp:4: integer constant out of range
lim.cpp:4: warning: decimal integer constant is so large that it is unsigned
cc: /usr/lib/gcc-lib/ntox86/2.95.3/cc1plus error 33


Running QNX 6.2 NC.


Thanks,

Oleksandr Brovko
Software Engineer

Kris Warkentin

Re: LLONG_MAX

Post by Kris Warkentin » Mon Nov 25, 2002 3:59 pm

This is fixed in 6.2.1. It's a problem with /usr/include/limits.h that you
can fix yourself. Basically, the LL suffix is in the wrong section of the
#ifdef. See the diff below.

cheers,

Kris

Index: limits.h
===================================================================
RCS file: /product/lib/c/public/limits.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -c -r1.33 -r1.34
*** limits.h 15 Nov 2001 14:47:26 -0000 1.33
--- limits.h 11 Mar 2002 20:51:23 -0000 1.34
***************
*** 49,61 ****
#endif

#if __INT_BITS__-0 == 64
- #define LLONG_MIN (-9223372036854775807LL-1) /* minimum value of a
long long */
- #define LLONG_MAX 9223372036854775807LL /* maximum value of a
long long */
- #define ULLONG_MAX 18446744073709551615ULL /* maximum value of an
unsigned long long */
- #else
#define LLONG_MIN (-9223372036854775807-1) /* minimum value of a long
long */
#define LLONG_MAX 9223372036854775807 /* maximum value of a long
long */
#define ULLONG_MAX 18446744073709551615U /* maximum value of an
unsigned long long */
#endif

#if __INT_BITS__-0 == 16
--- 49,61 ----
#endif

#if __INT_BITS__-0 == 64
#define LLONG_MIN (-9223372036854775807-1) /* minimum value of a long
long */
#define LLONG_MAX 9223372036854775807 /* maximum value of a long
long */
#define ULLONG_MAX 18446744073709551615U /* maximum value of an
unsigned long long */
+ #else
+ #define LLONG_MIN (-9223372036854775807LL-1) /* minimum value of a
long long */
+ #define LLONG_MAX 9223372036854775807LL /* maximum value of a
long long */
+ #define ULLONG_MAX 18446744073709551615ULL /* maximum value of an
unsigned long long */
#endif

#if __INT_BITS__-0 == 16

"Oleksandr Brovko" <obrovko@kse.kiev.ua> wrote in message
news:artatk$s3t$1@inn.qnx.com...
All,

Could somebody explain me why this does not compile?
----lim.cpp-------
#include <climits
void main()
{
long long i = LLONG_MAX;
}

getting following error:
lim.cpp: In function `int main(...)':
lim.cpp:4: integer constant out of range
lim.cpp:4: warning: decimal integer constant is so large that it is
unsigned
cc: /usr/lib/gcc-lib/ntox86/2.95.3/cc1plus error 33


Running QNX 6.2 NC.


Thanks,

Oleksandr Brovko
Software Engineer


Oleksandr Brovko

Re: LLONG_MAX

Post by Oleksandr Brovko » Mon Nov 25, 2002 4:56 pm

thanks,
at last I compiled boost library under QNX!


Oleksandr Brovko
Software Engineer
"Kris Warkentin" <kewarken@qnx.com> wrote in message
news:arth7t$19s$1@nntp.qnx.com...
This is fixed in 6.2.1. It's a problem with /usr/include/limits.h that
you
can fix yourself. Basically, the LL suffix is in the wrong section of the
#ifdef. See the diff below.

Rennie Allen

Re: LLONG_MAX

Post by Rennie Allen » Tue Dec 03, 2002 11:50 am

Oleksandr Brovko wrote:
thanks,
at last I compiled boost library under QNX!
Most excellent ! Any chance of this appearing on the new 3rd party CD ?

Rennie

Oleksandr Brovko

boost on 3rd party CD

Post by Oleksandr Brovko » Wed Dec 04, 2002 9:26 am

"Rennie Allen" <rallen@csical.com> wrote in message
news:3DEC9A76.3040802@csical.com...
Oleksandr Brovko wrote:
thanks,
at last I compiled boost library under QNX!

Most excellent ! Any chance of this appearing on the new 3rd party CD ?

Rennie
I cant answer your question, I am relatively new in QNX and dont know how
things are going.

Post Reply

Return to “qdn.public.qnxrtp.x86”