This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Pointer error with MIPS


Dear all,

I'm amazing about my cross compiler for TX39 (mips I).
The uninitialized data pointer is always located to address 0x00. i.e :

...
void reverse_copy(char *str_1,char *str_2)
{
char *temp_str; // also the temp_str point to 0x00 ??
...
...
}
...
int main(void)
{
char *str_1,*str_2;

str_1="test"; // GCC put str_1 to a dedicated address, but str_2 point to 0x00
reverse_copy(str_1,str_2); ... ... return 0;
}

So is there any constrains for GCC to put the uninitialized pointer within a valid address (above 0x80000000 is OK for my system).

I tried the same program under PC. The BorlandC keep these pointer within a valid address for PC (not 0x00), I don't know how the GCC handle it.

Best regards
Stewart



_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn/


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