User`s guide
Pragmas for the DSP56800 and DSP56800E
Illegal Pragmas
432
Targeting MC56F83xx/DSP5685x Controllers
This pragma corresponds to the Treat All Warnings as Errors setting in the C/C++
Preprocessor panel. To check this setting, use __option (warning_errors),
described in Checking Settings
. By default, this pragma is disabled.
Illegal Pragmas
If you enable the Illegal Pragmas setting, the compiler issues a warning when it
encounters a pragma it does not recognize. For example, the pragma statements in
Listing C.32
generate warnings with the Illegal Pragmas setting enabled.
Listing C.32 Illegal Pragmas
#pragma near_data off // WARNING: near_data is not a pragma.
#pragma ANSI_strict select // WARNING: select is not defined
#pragma ANSI_strict on // OK
The Illegal Pragmas setting corresponds to the pragma warn_illpragma,
described at To check this setting, use __option (warn_illpragma).
See Checking Settings
for information on how to use this directive.
Checking Settings
The preprocessor function __option() lets you check pragmas and other settings
that control the C/C++ compiler and code generation. You typically modify these
settings using various panels in the Project Settings dialog box.
The syntax for this preprocessor function is as follows:
__option(setting -name)
If the specified setting is enabled, __option() returns 1; otherwise it returns 0. If
setting-name is unrecognized, __option() returns false.
Use this function when you want one source file to contain code that uses different
settings. The example below shows how to compile one series of lines if you are
compiling for machines with the MC68881 floating-point unit and another series if
you are compiling for machines without it:
#if __option (code68881) // Code for 68K chip with FPU
#else
// Code for any 68K processor