<div dir="ltr">Hi Chris,<div><br></div><div>Thanks for the response.</div><div>I double-checked my arguments and tried -isystem and -internal-isystem again, but no change.</div><div><br></div><div>Is there anything else I can try?</div><div><br></div><div>This is the array of arguments I'm handing to clang:</div><div><br></div><div>```</div><div><font face="monospace">char const *args[] = {<br> "-triple", // target triple<br> /**/ "TRIPLE", // overriden later<br><br> "-disable-free", // Disable freeing of memory on exit<br> "-main-file-name", // Main file name to use for debug info<br> /* */ "INPUT_FILE",<br> "-target-cpu", "x86-64", // Target a specific cpu type<br> "-dwarf-column-info", // Turn on column location information<br><br> "-masm-verbose", // Generate verbose assembly output<br> "-mconstructor-aliases", // Emit complete constructors and destructors as aliases when possible<br> "-mthread-model", "posix", // The thread model to use, e.g. posix, single (posix by default)<br> "-momit-leaf-frame-pointer", // Omit frame pointer setup for leaf functions<br> "-mrelocation-model", "pic", // The relocation model to use<br> "-munwind-tables", // Generate unwinding tables for all functions<br> "-pic-level", "2", // Value for __PIC__<br><br> "-fms-extensions", // Accept some non-standard constructs supported by the Microsoft compiler<br> "-fms-compatibility", // Enable full Microsoft Visual C++ compatibility<br> "-fms-compatibility-version=14.16.27023", // Dot-separated value representing the Microsoft compiler version number to report in _MSC_VER (0 = don't define it (default))<br><br> "-resource-dir", // The directory which holds the compiler resource files<br> "E:\\Program Files\\LLVM\\lib\\clang\\9.0.0",<br><br> "-isystem",<br> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include",<br> "-isystem",<br> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include",<br><br> "-isystem",<br> "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\shared",<br> "-isystem",<br> "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\ucrt",<br> "-isystem",<br> "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.17763.0\\um",<br><br> "-fdebug-compilation-dir", // The compilation directory to embed in the debug info<br> "E:\\Documents\\Coding\\debug",<br> "-ferror-limit", "19", // Set the maximum number of errors to emit before stopping (0 = no limit).<br> // Emit an error if a C++ static local initializer would need a guard variable<br> "-fmessage-length", "120", // Format message diagnostics so that they fit within N columns or fewer, when possible<br> "-fno-use-cxa-atexit", // Don't use __cxa_atexit for calling destructors<br> "-fdelayed-template-parsing", // Parse templated function definitions at the end of the translation unit<br> "-fobjc-runtime=gcc", // Specify the target Objective-C runtime kind and version<br> "-fdiagnostics-show-option", // Print option name with mappable diagnostics<br> "-fcolor-diagnostics",<br> "-fmath-errno", // Require math functions to indicate errors by setting errno<br> "-faddrsig", // Emit an address-significance table<br> /**/"-femit-all-decls", // Emit all declarations, even if unused [verified to work - AZMR]<br><br> /**/"-x", "c", // Treat subsequent input files as having type <language><br> input_file,<br>};</font><br></div><div>```</div><div><br></div><div>Cheers,</div><div>Andrew</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 19 Jan 2020 at 23:57, Christian Gagneraud <<a href="mailto:chgans@gmail.com">chgans@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 20 Jan 2020 at 07:10, Andrew Reece via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi clang people,<br>
><br>
> I'm using clang as a frontend for the LLVM ORC JIT on Windows.<br>
> 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"<br>
><br>
> Is there a way to prevent these warnings? Preferably only for the system libraries.<br>
<br>
Use `-isystem` instead of `-I` ?<br>
<br>
Chris<br>
</blockquote></div>