[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] char arrays not being initilized

From: Lorne Gutz
Subject: [avr-gcc-list] char arrays not being initilized
Date: Thu, 17 Oct 2002 15:56:29 -0400


        If I define a char array like....
      char    test[] = "this is a test";

      The space for the array is allocated but the initilization 
is never done properly.  I can read or write to and element
of that array eg   test[3] = 'f';    and everythis is fine.

      Presently I am using gcc-3.2 on LINUX.  I have rebuild
my cross compiler as suggested in the latest gcc  avr-libc-20020203.
Earlier I was using gcc-3.0.3 and had the same results.

     Now the weird thing is that a system was put together on an old
NT box and everything worked fine!!!!

     I have seen this problem discribed here before but I don't
ever recall seeing and answer.

      I have spend some time digging into this problem and it seems
that it relates to the wrong registers being set up when the data is
copied into the array.  I tried it with a strcpy() with the same 
results.  I have looked at the machine code that gets produced
but not too sure of just what is wrong.

      So were I stand now is,......has someone else found a 
solution for this problem, or should I keep digging???


avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]