#define SOME_MACRO( foo, bar ) \
do \
{ \
foo(); \
bar(); \
} while (0) // warning: conditional expression
// is constant
That's the only possible way to correctly enforce using a semicolon following a call to SOME_MACRO(a,b);
Most insidiously, you can't wrap the macro with #pragma warning (push, disable, pop) because it's a macro. So the warning can only be suppressed where you call it, not where it's defined!
That's why I globally disable this warning in all my projects. I've never been saved by it, and it's sucked away enough of my life.
I've used up enough of your time already, but if you feel like it...:
Do you know if gcc has the equivalent of #pragma warning( disable: N ) ? i.e. could you disable your argc and argv warning for just that source file, and no other?
If yes, then is there a way to "scope" that disable to be within a header file? (#pragma warning(push) and #pragma warning(pop))
But check this out:
That's the only possible way to correctly enforce using a semicolon following a call to SOME_MACRO(a,b);Most insidiously, you can't wrap the macro with #pragma warning (push, disable, pop) because it's a macro. So the warning can only be suppressed where you call it, not where it's defined!
That's why I globally disable this warning in all my projects. I've never been saved by it, and it's sucked away enough of my life.