Precompiled headers disable all warnings
We have warnings disabled for system/external headers, for obvious reasons. We have warnings enabled in OpenMW, also for obvious reasons. This is an example of a header intended for precompilation that has been generated by CMake:
/* generated by CMake */
#pragma system_header
#ifdef __cplusplus
#include <sol/sol.hpp>
#include <osg/State>
#include <osg/StateSet>
#include <osg/Node>
#include <osg/Drawable>
#include <osg/Camera>
#include <MyGUI_Widget.h>
#include <algorithm>
#include <filesystem>
#include <fstream>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <vector>
#endif // __cplusplus
For some reason (either a CMake bug or an MSVC bug, or both), the #pragma system_header
directive is leaking out of the precompiled header and into every file that consumes it, which means that once you turn off precompiled headers, e.g. for your Ccache Ninja MSVC build, you get buried under a mountain of warnings that have been suppressed since mid-2022.
We need to:
- Figure out why this is happening, and hopefully address it (maybe we can just stop CMake putting the
#pragma
there) so people get yelled at when they're supposed to be. - Deal with the existing warnings, either by fixing them, or by disabling them because we've clearly got the equivalents disabled on other platforms.