>From: Mark Wilden <[EMAIL PROTECTED]>

>but it doesn't sound like
>rocket science to strip out resources whose IDs (the identifiers 
>used in the .rcp) are only referenced by dead code.

In fact, it would be extremely difficult to do this. First off, Codewarrior
does not really "know" anything about how PalmOS works. If it generates a
resource symbol, say symbol LowMemAlert with an ID of 1020, to the compiler
this is simply a C preprocessor symbol assignment. I can call
FrmAlert(LowMemAlert) or FrmAlert(1020) with the same runtime result, but
the compiler has no idea what the "FrmAlert" function does or why I'm
passing a particular value. Does the appearance of the value 1020 anywhere
in the program mean that I am referring to the LowMemAlert resource? I don't
think so! Some people even assign their own symbols for resource IDs, so the
values can get lost pretty easily.

Basically, the compiler cannot look at a piece of code to determine what
symbols or values in the code have significance to another section of the
program. If you think about what is going on when you compile a program, you
should start to understand the point that I am trying to make. As someone
else stated, this is a class of problem in computer science that is related
to the famous "halting" problem -- it is truly intractable.

  Doug Gordon
  GHCS Software


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

Reply via email to