William Killian wrote: > But please name any compiler that will automatically not generate a > return statement at the end of a function. HiTech PICC-18 for example (and probably PICC, too, as they are pretty similar). There probably are others. > I don't know how the PIC compilers handle automatic variables but they > are 'created' and 'destroyed' at the beginning and end of a function so > would there be unreachable code put in to fix the 'stack' as well? It doesn't sound as if you were familiar with the concept of a static, compiled "stack". There is no stack to "fix", variables don't get created and destroyed like with a normal, stack-based C implementation. Every function has a fixed starting location for local variables in the memory area set aside for its "variable stack". Which means in essence that every local variable has a pre-determined address that doesn't change from one call to the function to the next. This starting location of the "variable stack" is determined at link time, from the static call tree and the space requirements for each function. (That's why recursion is not possible with this method, and there are limits for the use of function pointers.) > This message contains confidential information and is intended only for > the individual named. If you are not the named addressee you should not > disseminate, distribute or copy this e-mail. ??? I couldn't help but not take this seriously in replying to the message... Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist