There should be a way to get compile/link time errors if you use an API
that's not supported in the OS you're compiling for. The header files
currently lack the conditionals needed to support this. Of course, you can
use an older SDK to avoid using traps that are too new.
Realistically, it doesn't take long before you run into some case where you
want to use an API that was changed or added within the range of the OS
versions you want to support. This leads to ROM version tests at run-time,
with calls to different traps based on the result. It's pretty hard to get a
compiler or linker to warn you about misuse of traps in that kind of code,
since the ROM version test has to be executed at run-time, not compile or
link time. Who knows, maybe a C guru might be able to use macros to get
something like this to work.
My suggestion is to take care during development to check the ROM version in
which APIs were introduced, and then to run Gremlins on your application
using several different ROMs that cover the range of OS versions you
support. It's especially important to test on the oldest device that you
support.
-
Peter Epstein
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/