warn_resultnotused

Controls the issuing of warning messages when function results are ignored.

Syntax
  #pragma warn_resultnotused on | off | reset
  
  
Remarks

If you enable this pragma, the compiler issues a warning message when it encounters a statement that calls a function without using its result. To prevent this, cast the statement with (void). Listing: Example of Function Calls with Unused Results provides an example.

Listing: Example of Function Calls with Unused Results

#pragma warn_resultnotused on

extern int bar();

void func()

{

   bar(); /* WARNING: result of function call is not used. */

   void(bar()); /* OK: void cast suppresses warning. */

}

This pragma does not correspond to any panel setting. By default, this pragma is off.