This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc-2.95.2: size of a long with -mcpu=ultrasparc on Solaris 2.6
- To: bug-gcc at gnu dot org
- Subject: gcc-2.95.2: size of a long with -mcpu=ultrasparc on Solaris 2.6
- From: Martin Buchholz <martin at xemacs dot org>
- Date: Sat, 27 Nov 1999 02:17:20 -0800 (PST)
- Reply-To: martin at xemacs dot org
The use of the -mcpu=ultrasparc option affects the size of LONG_MAX.
My machine certainly is an ultrasparc, but it's not running a 64-bit
operating system. I think this used to work correctly on older
versions of egcs.
Shell transcript follows (nice short test case):
$ cat long-max.c
#include <limits.h>
int foo = LONG_MAX;
$ /usr/local/src/gcc-2.95.2/inst/solaris/bin/gcc -c long-max.c
$ /usr/local/src/gcc-2.95.2/inst/solaris/bin/gcc -mcpu=ultrasparc -c long-max.c
long-max.c:2: warning: overflow in implicit constant conversion
$ /usr/local/src/gcc-2.95.2/inst/solaris/bin/gcc -E long-max.c | tail -1
int foo = 2147483647L ;
$ /usr/local/src/gcc-2.95.2/inst/solaris/bin/gcc -mcpu=ultrasparc -E long-max.c | tail -1
int foo = 9223372036854775807L ;
$ uname -a
SunOS polgar.666.com 5.6 Generic sun4u sparc SUNW,Ultra-30