Reputation: 10820
What could be the meaning of this notation.
#pragma warning( disable : 4530 )
Upvotes: 2
Views: 794
Reputation: 25487
16.6/1- "A preprocessing directive of the form # pragma pp-tokensopt new-line causes the implementation to behave in an implementation-defined manner. Any pragma that is not recognized by the implementation is ignored."
An implemention defined behavior is supposed to be documented by the vendor. So you need to look into the documentation.
Upvotes: 1
Reputation: 11648
As everybody said #pragma
is used to disable the warning coded 4530
..
But from MSDN,
C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
Also,
When the /EHsc option has not been enabled, an object with automatic storage in the frame, between the function doing the throw and the function catching the throw, will not be destroyed.
To get rid of this,
Compile the sample with /EHsc to resolve the warning.
It is unwise to disable all the warnings as they creep in. And in this case instead of silencing it, you can compile it with the /EHsc option...
Hope it helps..
Upvotes: 1
Reputation: 454920
It means disable warning message numbered 4530
.
The general syntax of this pragma is:
#pragma warning( warning-specifier : warning-number-list [; warning-specifier : warning-number-list...] )
More info here
Upvotes: 1
Reputation: 26171
Its does exactly what it says it does, it disables compiler warning number 4530. On a side note, this isn't a free ticket to just ignore warnings, it should only be used for special cases
Upvotes: 2
Reputation: 99535
This line will disable all warnings with the code 4530. Check this article for more details.
Upvotes: 1