Re: wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
Re: wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
- Subject: Re: wrong value for LONG_MAX (9223372036854775807 rather than 2147483647) on macintosh 10.6 ?
- From: CSights <email@hidden>
- Date: Fri, 4 Dec 2009 09:33:24 -0500
Hi all,
Thanks for your replies...
> This is the correct value if you're building 64-bit. You didn't include the
> cc command in your transcript, so I can't tell.
> Which compiler flags did you use? If none, then on 10.6 you get a 64
> bit build. With the 64 bit ABI, long is a 64 bit value.
In the original message I did not use any switches (g++ file.cpp). After
reading the man page, it seems "-m32" compiles the code for 32-bit
architectures:
$ g++ -m32 limit_check.cpp
and I get the "old" limits for LONG_MAX.
$ ./a.out
LONG_MIN=-2147483648
LONG_MAX=2147483647
LLONG_MIN=-9223372036854775808
LLONG_MAX=9223372036854775807
In case you're curious, the only reason I care about this is because I want
the program output match when the program is run on a 32bit and 64bit machine
for debugging purposes. (It is easier to debug on my home computer!)
I take it the default behavior in 10.4 (g++ version 4.0.1) was to compile for
32-bit architectures?
Thanks again!
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