[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


warn_no_side_effect

Description:

Controls the issuing of warnings for statements that are redundant.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC

NEC V800

Intel x86

MIPS

Embedded 68K

Prototype:
  #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.

Example of pragma warn_no_side_effect:
#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."


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000