Search notes:

cl: pragma warning push/pop

#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)
Github repository about-cl, path: /pragma/warning/push-pop/disable/prog.c
The program can be compiled with this Makefile:
.SILENT:

prog.exe: prog.obj
	link /nologo prog.obj /out:prog.exe

prog.obj: prog.c
	cl /nologo /W4 /c prog.c /Foprog.obj
Github repository about-cl, path: /pragma/warning/push-pop/disable/Makefile

See also

cl

Index