Skip to content

Warning inferno - fix warnings, then fix warnings

Resolves #8674.

We discovered yet another problem with warnings with MSVC. Part of it turned out to be a compiler bug where if a single header was marked as a system one twice (e.g. by the type of include path and a #pragma), then a whole TU that included it would be treated as a system header and operate at the system warning level.

To avoid triggering that, the repo root was marked as not a system include directory anymore. It turns out that had been a very bad idea as it meant that any warning whose root cause was due to something in a header wouldn't be triggered for any compiler.

That meant that as well as resolving the MSVC-specific warnings that hadn't been working properly (mostly loads of narrowing conversion ones, as GCC (and therefore Clang) pretends C++11 didn't make lots of implicit narrowing conversions illegal), there were lots of warnings caused by header files that needed fixing for other compilers.

Don't worry, though, we only touched 358 files, and probably found and squashed more bugs than we introduced or covered up. I know I definitely fixed at least one real bug with this, although I've forgotten what it was. Thanks a tonne to @Assumeru for helping with this, as it was horrible and tedious.

Merge request reports

Loading