On 17 Jul 2004 at 11:57, Ben Combee wrote: > At 11:23 AM 7/17/2004, you wrote: > >The only thing is there is no "return error" statement in the > >StartApplication() function. When I put the "return error" as the last > >statement in the StartApplication function, the application works on the > >"W". > > If you leave off the "return error" statement in StartApplication, then you > rely on whatever value happens to be in the D0 register when the function > ends as the return value. This can be garbage depending on what code was > running in the last OS call.. it's just that on the "W", some non-zero > value was left in D0, but on other devices, it had been cleared. > > You were just lucky this didn't happen before. I'm also surprised that the > compiler didn't catch it -- do you have warnings turned on? CW may only > catch this when you optimize the code at level 1 or better; I think the > code that detects missing return statements is part of the optimizer. > > -- Ben Combee, DTS technical lead, PalmSource, Inc. > "Combee on Palm OS" weblog: http://palmos.combee.net/ > Palm OS Dev Fourm Archives: http://news.palmos.com/read/all_forums/
I will check the compiler settings. I figured it was just a default value or something but funny that it happens consistenly on "W" Tungstens but never on other Palms. No matter, it was sloppy coding and I have corrected that. Thanks, -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
