Home > Fresh News > pragma warning

pragma warning

February 3rd, 2012 Leave a comment Go to comments

#pragma warning – enables selective modification of the behavior of compiler warning messages.

Additional “pragma warning” parameter is suppress – pushes the current state of the pragma on the stack, disables the specified warning for the next line, and then pops the warning stack so that the pragma state is reset.

Also __pragma() can be used instead of #pragma which allows it to use inside macros:
[C]#define __const_cond( c ) \
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
( c ) \
__pragma(warning(pop))[/C]

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.