#pragma warning(push) followed by a #pragma warning(disable: …) can be used to prevent the compiler from issuing a warning until the suspension is nullified again with #pragma warning(pop).
For example, if a c program is compiled with /W4, it would warn with warning C4100 if a function parameter is not referenced. In the following example, this warning is inhibited with the necessary #pragma.
#include <stdio.h>
int num() {
return 42;
}
#pragma warning(push)
#pragma warning(disable: 4100)
int main(int argc, char *argv[]) {
printf("Hello world, the numer is %d\n", num());
}
#pragma warning(pop)