> void testCrash(void)
> {
>     Char st[6];             works
>     //Char st[6]="a";    works
>     //Char st[6]=" ";     crashes
>     //Char st[6]="";      crashes
> }
> 
> I know how to work aroung this, but I get the feeling I'm missing 
> something fundamental. 

you should avoid doing:

  [6] = "{anything}"

it doesn't matter if it works or not, its just something the compiler
doesn't really know much about at compile time (depending on your compiler).
it isn't sure if the string you are initializing should be static or
dynamic. anything dynamic ends up in your 'data' section = globals.

if you want to initialize your strings, do this:

  Char st[6];

  StrCopy(str, "a");
  StrCopy(str, " ");
  StrCopy(str, "");

and, then it'll store the strings as constant strings - which end up
in 'rodata' sections normally, which can easily be thrown into a the
code section with a relative reference (static values).

your compiler is getting confused; teach it a lesson by programming
it better :) it does exactly the same thing basically :)

... mm.. maybe still need more coffee, seem to be too helpful today :)

---
Aaron Ardiri (Skype:: callto://ardiri)
PalmOS Certified Developer
[EMAIL PROTECTED]
http://www.mobilewizardry.com/members/aaron_ardiri.php

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to