[cfe-dev] How to silence warnings from system headers

Andrew Reece via cfe-dev cfe-dev at lists.llvm.org
Sun Jan 19 10:09:51 PST 2020


Hi clang people,

I'm using clang as a frontend for the LLVM ORC JIT on Windows.
When I include system headers I get long error messages. For example, with
stdlib.h I get a lot of: "warning: macro expansion producing 'defined' has
undefined behavior"

Is there a way to prevent these warnings? Preferably only for the system
libraries.
The documentation I read suggested that system libraries shouldn't throw up
these errors.

I tried -Wno-expansion-to-defined, -fms-extensions, -fms-compatibility-fms,
-compatibility-version=14.16.27023. I also tried to reference the system
library folder by -isystem, -internal-isystem and -c-isystem

None of these seemed to work. Do you have any suggestions?

Thanks,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200119/a46b300e/attachment.html>


More information about the cfe-dev mailing list