wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
- Subject: wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
- From: CSights <email@hidden>
- Date: Thu, 3 Dec 2009 19:11:15 -0500
Hi,
It appears that on macintosh 10.6 LONG_MAX has the same value as LLONG_MAX
(both are 9223372036854775807).
According to http://home.att.net/~jackklein/c/inttypes.html#problems
LONG_MAX should be 2147483647.
Some version info:
$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5646) (dot 1)
$ uname -a
Darwin xxxxxxxxxxxxxxxxxxxxxx 10.2.0 Darwin Kernel Version 10.2.0:
Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
Below is a program that demonstrates this:
$ cat long_max.cpp
#include <iostream>
#include <climits>
int main()
{
std::cout << "LONG_MIN="<<LONG_MIN<<"\n";
std::cout << "LONG_MAX="<<LONG_MAX<<"\n";
std::cout << "LLONG_MIN="<<LLONG_MIN<<"\n";
std::cout << "LLONG_MAX="<<LLONG_MAX<<"\n";
}
$ ./a.out
LONG_MIN=-9223372036854775808
LONG_MAX=9223372036854775807
LLONG_MIN=-9223372036854775808
LLONG_MAX=9223372036854775807
Is this right?
C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden