Controls the issuing of warnings for statements that are redundant.
Compatibility:This pragma is compatible with the following platform targets:
#pragma warn_no_side_effect on | off | reset
Remarks:
When this pragma is on, the compiler will issue a warning when it encounters a statement that produces no side effect. To prevent a statement with no side effects from signalling this warning, cast the statement with (void). See Listing 8.16 for an example.
#pragma warn_no_side_effect on
void foo(int a,int b)
{
a+b; // warning: expression has no side effect
(void)(a+b); // void cast suppresses warning
}
To check whether this option is on, use __option (warn_no_side_effect), described in "Checking Options." For more information about this warning see "Catching Redundant Statements."