English
Language : 

AN3350 Datasheet, PDF (126/185 Pages) STMicroelectronics – eTPU compiler tools
Using pragmas
#pragma opt_unroll_loops reset
void fast_func_B(void)
{
/* ... */
}
AN3350
16.3
Determining which settings are saved and restored
Not all pragma settings are saved and restored by pragmas push and pop. Pragmas that do
not change compiler settings are not affected by push and pop. For example, pragma
message cannot be saved and restored.
Example 77 shows an example that checks if the ANSI_strict pragma setting is saved
and restored by pragmas push and pop.
Example 77 Testing if pragmas push and pop save and restore a setting
/* Preprocess this source code. */
#pragma ANSI_strict on
#pragma push
#pragma ANSI_strict off
#pragma pop
#if __option(ANSI_strict)
#error "Saved and restored by push and pop."
#else
#error "Not affected by push and pop."
#endif
16.4
Invalid pragmas
If you enable the compiler’s setting for reporting invalid pragmas, the compiler issues a
warning when it encounters a pragma it does not recognize. For example, the pragma
statements in Example 78 generate warnings with the invalid pragmas setting enabled.
Example 78 Invalid pragmas
#pragma silly_data off
// WARNING: silly_data is not a pragma.
#pragma ANSI_strict select // WARNING: select is not defined
#pragma ANSI_strict on
// OK
Table 26 shows how to control the recognition of invalid pragmas.
Table 26. Controlling invalid pragmas
To control this option from here...
Source code
Command line
use this setting
#pragma warn_illpragma
-warnings illpragmas
126/185
Doc ID 018512 Rev 2