Jeff Gilchrist
Usenet Archive
- Joined
- Jan 17, 2005
- Messages
- 3
- Reaction score
- 0
I have tried searching the newsgroup along with the GCC site and could not find what I think is probably a simple solution.
I am using a 64bit unsigned long long integer and can manipulate 64bits within the variable but I cannot assign a 64bit constant to it.
With my simple test program:
int main
{
unsigned long long test;
test = 18446744073709551606;
test = 0xFFFFFFFFFFFFFFF6;
}
I get the following errors with gcc v3.3.x and 3.4:
test.cpp:7: warning: this decimal constant is unsigned only in ISO C90 test.cpp:7: error: integer constant is too large for "long" type test.cpp:8: error: integer constant is too large for "long" type
I have also tried using variations with no success:
test = (unsigned long long)18446744073709551606;
There must be a way to do this, and it is probably just something simple that I am overlooking. Can anyone help?
Thanks.
I am using a 64bit unsigned long long integer and can manipulate 64bits within the variable but I cannot assign a 64bit constant to it.
With my simple test program:
int main
{
unsigned long long test;
test = 18446744073709551606;
test = 0xFFFFFFFFFFFFFFF6;
}
I get the following errors with gcc v3.3.x and 3.4:
test.cpp:7: warning: this decimal constant is unsigned only in ISO C90 test.cpp:7: error: integer constant is too large for "long" type test.cpp:8: error: integer constant is too large for "long" type
I have also tried using variations with no success:
test = (unsigned long long)18446744073709551606;
There must be a way to do this, and it is probably just something simple that I am overlooking. Can anyone help?
Thanks.