Pragma Scope. NXP CodeWarrior Development Studio
Reklam
Reklam
Pragma Scope
27.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 the listing below, generates warning with the invalid pragmas setting enabled.
Listing 27-5. 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
The table below lists various options on how to control the recognition of invalid pragmas.
source code command line
Table 27-1. Controlling invalid pragmas
To control this option from here...
CodeWarrior IDE
use this setting
Illegal Pragmas in the C/C++ PowerPC Compiler >
Warnings panel
#pragma warn_illpragma
-warnings illpragmas
27.5 Pragma Scope
The scope of a pragma setting is limited to a compilation unit (a source code file and the files that it includes).
At the beginning of compilation unit, the compiler uses its default settings. The compiler then uses the settings specified by the CodeWarrior IDE's build target or in commandline options.
The compiler uses the setting in a pragma beginning at the pragma's location in the compilation unit. The compilers continues using this setting:
• until another instance of the same pragma appears later in the source code
• until an instance of pragma pop
appears later in the source code
• until the compiler finishes translating the compilation unit
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
426 Freescale Semiconductor, Inc.
İndir
Reklam