We use clang with -fmoduleand -fcxx-moduleto enable module support, as described in http://clang.llvm.org/docs/Modules.html . We are already seeing a significant improvement in build time by defining module maps for our core libraries.
However, we have several library headers that use pragmas to turn off warnings for specific lines, for example:
template <typename TFloat>
static bool exactlyEqual(TFloat lhs, TFloat rhs)
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
return lhs == rhs;
#pragma clang diagnostic pop
}
When this header is pulled out as a precompiled module, it seems that the internal clang view does not save pragma information, and a warning is still emitted. Since we view warnings as errors, this leads to compilation failure. Some may argue that it’s easy to disable it float-equalcompletely, but we have a bunch of other cases with various warnings that we don’t want to disable globally.
-Wno-system-headers -isystem, ( ), , , , . , - , (.. -isystem/ ), .
_Pragma(...) #pragma, .
, clang?
UPDATE: https://github.com/MikeWeller/ClangModuleWarnings,
UPDATE: , [system] . , , . , , .