This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/1790: g++ does not compile 64Bit integer features
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1790: g++ does not compile 64Bit integer features
- From: davidf at etec dot com
- Date: 26 Jan 2001 23:31:00 -0000
- Reply-To: davidf at etec dot com
>Number: 1790
>Category: c++
>Synopsis: g++ does not compile 64Bit integer features
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 26 15:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: davidf@etec.com
>Release: gcc 2.95
>Organization:
>Environment:
Yellow Dog Linux, fresh install
>Description:
I have a simple example that breaks the compiler. First of all the gcc will compile the code (below), but g++ will not.
I have tried many permutations. But I cannot use 64bit integers.
----------- code snippet ------------------------
#include <stdint.h>
/* Cannot use INT64_MIN or INT64_MAX as these
are undefined when the g++ compiler is run. Even
thought its clear it should be defined if __cplusplus
is defined (see stdint.h). Which it seems to be at
compiler initialization. Go figure?
*/
int main()
{
int64_t test;
test = -(9223372036854775807)-1;
test = 9223372036854775807;
return 0;
}
------------------------------------------------------
Gives error that value will not fit in test.
If test were 64bit then it would be ok. But it seems to make test a 32bit integer.
>How-To-Repeat:
Under YellowDogLinux, with the above code snippet named junk.c, it will work. But name it junk.cpp or compile it under g++ and it will fail.
>Fix:
No workaround found yet.
>Release-Note:
>Audit-Trail:
>Unformatted: