This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in Ultrasparc climits


Hi,

Take the following program lim.cpp :

#include <climits>
#include <iostream.h>

int main()
{
  cout << LONG_MAX << endl;
  return 0;
}


wsbob:/users/wsbob_4/ocs/pbienst$gcc -v
Reading specs from
/users/wsbob_4/ocs/pbienst/bin/gnu/lib/gcc-lib/sparc-sun-solaris
2.6/2.95.1/specs
gcc version 2.95.1 19990816 (release)
wsbob:/users/wsbob_4/ocs/pbienst$g++ lim.cpp
wsbob:/users/wsbob_4/ocs/pbienst$a.out
2147483647

This is OK. Now add -mcpu=ultrasparc:

wsbob:/users/wsbob_4/ocs/pbienst$g++ -save-temps -mcpu=ultrasparc lim.cpp
lim.cpp: In function `int main()':
lim.cpp:6: integer constant out of range
lim.cpp:6: warning: decimal integer constant is so large that it is unsigned
wsbob:/users/wsbob_4/ocs/pbienst$tail lim.ii
# 2 "lim.cpp" 2


int main()
{
  cout << 9223372036854775807L   << endl;
  return 0;
}

Greetings,

-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - University of Gent
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]