warn_resultnotused

Controls the issuing of warnings when function results are ignored.

Syntax
  #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). The following listing provides an example.

Listing: 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 Language panel. To check this setting, use __option (warn_resultnotused), described in Checking Pragma Settings. By default, this pragma is disabled.