"Dan Peluso" <[EMAIL PROTECTED]> wrote in message news:69186@palm-dev-forum... > > > On current versions of CodeWarrior, defining a variable in an inner > > block makes no difference on stack utilization at all. The inner scope > > affects accessibilty, but all variable allocation decisions are made at > > a function level, not a scope level. > > Out of curiosity, can you tell me in which version this was implemented. I > also began defining variables within blocks (especially less likely to > execute blocks) thinking that this would help with stack usage. I have to > admit though I never did check if it made a difference.
No versions of CodeWarrior for Palm OS implement block-specific stack allocation semantics, as far as I know. The C/C++ front-end doesn't even send this block information to the compiler back-end that generates the 68K code. However, the optimizer and back-end do regenerate scope information based on the real scope of variables, tracking a range of statements from the point the variable is assigned to the last point it can be accessed. That information is used to decide how variables get allocated to registers and to the stack. This may change in future compiler versions -- no promises, however. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
