I have the following three consecutive warnings:
Warning C4068 unknown pragma ...\microsoft visual studio 14.0\vc\include\comutil.h 53
... 54
... 54
The related lines are:
#pragma warning(push)
#pragma warning(disable: 4290)
#pragma warning(disable: 4310)
The Platform Toolset is the usual v140 and the Target Platform version is 8.1. The warning level is W3.
I read the current #pragma warning documentation.
As I understand the first line saves the current state of warning settings.
The following two lines disable the warnings 4290 4310 for the code ahead until a #pragma warning(pop) restores the previously saved state.
Why does #pragma warning appear as unknown?
In the project's Property Pages I set
I rebuilt the project, which produced a Debug dir with a
*.ifile for each C++ file, containing all macros expanded (see here).The files are very large, but they also contain useful
#linedirectives showing when the compiler accesses and exits from a header file. So I grepped for the name of the header file raising the error and I was able to detect that thewarningin#pragma warning(push)had been expanded too, which caused the not found warning.Since I had included a number of headers from a third party GNU project (where this type of
#pragmais not defined), it was relatively simple to find the#define warningmacro raising the compiler warning.