Is there any advantage or disadvantage of using a C block scope in a function or specifically inside an Interrupt Handler?
From the link - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472i/CJAIIDCG.html - Refer stack usage.
In general, you can lower the stack requirements of your program by:
- Writing small functions that only require a small number of variables.
- Avoiding the use of large local structures or arrays.
- Avoiding recursion, for example, by using an alternative algorithm.
- Minimizing the number of variables that are in use at any given time at each p oint in a function.
- Using C block scope and declaring variables only where they are required, so overlapping the memory used by distinct scopes.
Advantage or disadvantage in using the C block Scope is not very clear.