Hello Gianni,
if the local variable is declared but not used, no Chora code is generated and Embedded Wizard reports a warning. If the local variable is involved in a Chora expression (even just an initialization expression), Chora compiler will generate the variable. This unused local variable elimination is in Chora compiler rudimentary. The 'C' compiler is more precise. It reports the warning, when the local variable really doesn't make sense.
The problem, you have here, is the approach to use conditional compilation of Chora code depending on a 'C' define. The Embedded Wizard, however, has no idea about the eventually existing 'C' defines. Since the variable is used in 'C' code only, one possible workaround would be, to declare the variable within a native block as 'real' 'C' variable. For example:
// declare 'C' local variable
$if !$prototyper
native
{
#if (EnableScreenSaver)
XBool loadScreenSaver;
#endif
}
$endif
// use the 'C' local variable
$if !$prototyper
native
{
#if (EnableScreenSaver)
loadScreenSaver = 0;
#endif
}
$endif
Hope it helps you further!
Best regards
Paul banach