problem with int64 in rh fdeora 4 ...
Hi ALL.
I have a problem in call reference with int64 (in redhat fedora core 4 with gcc 4.0).
see this simple code:
//test1.c -->
#include <stdio.h>
#define ull unsigned long long int
void foo(ull a){
printf("a= %llx\n",a);
}
int main(void){
ull a=0x123456789abcde;
foo(a);
return 0;
}
//test1.c <--
this code is compiled with this warning :
test.c: In function ‘main’:
test.c:8: warning: integer constant is too large for ‘long’ type
but output file executes with correct output.
but see this code
//test2.c -->
#include <stdio.h>
#define ull unsigned long long int
void foo(ull& a){ //changed to call by reference
printf("a= %llx\n",a);
}
int main(void){
ull a=0x123456789abcde;
foo(a);
return 0;
}
//test2.c <--
this code generates this errors :
test.c:4: error: syntax error before ‘&’ token
test.c: In function ‘foo’:
test.c:5: error: ‘a’ undeclared (first use in this function)
test.c:5: error: (Each undeclared identifier is reported only once
test.c:5: error: for each function it appears in.)
test.c: In function ‘main’:
test.c:8: warning: integer constant is too large for ‘long’ type
I want to use an unsigned int 64 with call reference.this code has no error with redhat 7.3 (gcc 2.96).
please help me ....
Last edited by mohtashami; 11-06-2005 at 01:37 AM.
|