User`s guide
Pragmas for the DSP56800 and DSP56800E
Pragma Reference
429Targeting MC56F83xx/DSP5685x Controllers
Listing C.29 Example for #pragma warn_ptr_int_conv
#pragma warn_ptr_int_conv on
char *my_ptr;
char too_small = (char)my_ptr; // WARNING: char is too small
See also “warn_any_ptr_int_conv,”.
This pragma corresponds to the Pointer / Integral Conversions setting in the C/C++
Warnings panel. To check this setting, use __option (warn_ptr_int_conv),
described in Checking Settings
. By default, this setting is disabled.
warn_resultnotused
Controls the issuing of warnings when function results are ignored.
Prototype
#pragma warn_resultnotused on | off | reset
Remarks
If you enable this pragma, the compiler issues a warning when it encounters a
statement that calls a function without using its result. To prevent this, cast the
statement with (void). Listing C.30
provides an example.
Listing C.30 Example of Function Calls with Unused Results
#pragma warn_resultnotused on
extern int bar();
void foo()
{
bar(); // WARNING: result of function call is not used
(void)bar(); // ‘void’ cast suppresses warning
}
This pragma does not correspond to any panel setting in the C/C++ Preprocessor
panel. To check this setting, use __option (warn_resultnotused),
described in Checking Settings
. By default, this pragma is disabled.