Ben and Joe, thanks for your responses. Ben wrote: > Link with the CW startup library anyway, just make sure it is listed in the > link order/segment list after your startup code. You should only have the > __wswtch__ and related compiler code linked into things. If you don't like > this, then just include the appropriate source file from the CW runtime > directly in your project -- search the CW runtime source tree to find the > right one. Found it, thanks. Yes, including that little section (which is in assembly) does work. Seems like black magic to me. And I wonder what will happen when they go to ARM. Will it still work? Joe wrote: > FWIW, the reason that the problem appears only after the switch statement > has a certain number of members is that the compiler tries to be somewhat > intelligent about switch statements. Different implementations are used > depending upon number of cases, etc. This all seems like a really bad idea. The concept that the switch statement suddenly does not work after adding a 5th case statement, because I don't have the startup library linked in seems like it is guaranteed to mess things up. It's not like switch is some obscure part of the C language. It's like suddenly sprintf doesn't work quite right because you add a 5th format element or + stops working because you did an a+b+c+d+e rather than a+b+c+d. How was I supposed to know what the problem was? Is this documented somewhere? I'm not unhappy because switch doesn't work right (well, it is disappointing), but rather that it _was_ working and then suddenly it didn't and the tools I have didn't let me know what the problem was. So, I wasted a day trying to figure it out. What else lurks out there to bite me on the butt? (Frankly, this ranks up there with the MemSet issue. Who on earth decided to change the order of arguments to MemSet compared to memset?). Well, thanks to those who helped. Eventually, I think I'll get the hang of programming on the Palm. Then, they'll probably move me to the RIM. Clark -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
