R
Rakesh UV
Hi,
If i am not putting the function prototype of a function
returning a pointer, i get a core dump.Though this will happen less
probably on 32 bit machine
example
int main(int argc , char **argv)
{
char *base = basename(argv[0]) ;
printf("%s",base);
return 0;
}
The compiler assumes that basename is returning an int and thus we
loose 32 bit of the actual address, because pointer is 64 bit and
integer is 32 bit in 64 bit machines
I am working on
Os linux x86_64 2.6.9
Machine Hp
compiler gcc 3.46
Is there any option in GCC to make the default return value as long so
that i can preserve the actual address returned
or
do we have any other way in C to make it right
I know that putting the prototype would solve the problem, but
unfortunately
there are huge number of files
Rakesh UV
If i am not putting the function prototype of a function
returning a pointer, i get a core dump.Though this will happen less
probably on 32 bit machine
example
int main(int argc , char **argv)
{
char *base = basename(argv[0]) ;
printf("%s",base);
return 0;
}
The compiler assumes that basename is returning an int and thus we
loose 32 bit of the actual address, because pointer is 64 bit and
integer is 32 bit in 64 bit machines
I am working on
Os linux x86_64 2.6.9
Machine Hp
compiler gcc 3.46
Is there any option in GCC to make the default return value as long so
that i can preserve the actual address returned
or
do we have any other way in C to make it right
I know that putting the prototype would solve the problem, but
unfortunately
there are huge number of files
Rakesh UV