OPTIMIZATIONS
Compilation Unit
-OnCstVar
None
None
None
None
This option provides you with a way to switch OFF the replacement of CONST variable by the constant value.
const int MyConst = 5;
int i;
void foo(void) {
i = MyConst;
}
If the -OnStVar option is not set, the compiler replaces each occurrence of MyConst with its constant value 5; that is i = MyConst is transformed into i = 5;. The Memory or ROM needed for the MyConst constant variable is optimized as well. With the -OnCstVar option set, this optimization is avoided. This is logical only if you want unoptimized code.