Am Fr, 2003-11-21 um 16.32 schrieb Ton van Overbeek:

Ton,

> If you compile your small test program with -S (=generate assembly)
> you see what is happening, For MAX=9 the cmd struct is initialized
> by code. For MAX=10 there is a copy in the .data section which gets
> copied to the stack at the start of the routine.
> 
> Here is where it goes wrong
> 
> The memcopy which copies to the stack, takes its source address
> relative to the .text section. It should do it relative to the .data section.
> Hence your local copy on the stack contains garbage.

Ah well, this explains everything. I seriously started to doubt my
sanity ;)

> I believe this is a long standing bug in prc-tools and I tried to find
> one of John Marshall's messages about it, but I could not find it.
> I hope John can comment on this.
> 
> Workaround: Do not use initializers, initialize your struct via code.

That's what I've done, though I still would like to see this fixed.
Should I report this at prc-tools bug tracker? There seem to be similiar
bugs filed for years with no activity.
-- 
Daniel Seifert <[EMAIL PROTECTED]>


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

Reply via email to