<div dir="ltr">Not a bug - intended behavior & not the only diagnostic with this property (that the behavior is different between preprocessed and unpreprocessed source). Clang uses macro spelling as a means to reduce false positives in diagnostics - without them, there are more false positives.<br><br>Clang does have the -frewrite-includes flag that should preserve more of the macro content while still making a standalone file that could be compiled without searching for includes.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 21, 2019 at 7:29 PM Ian Collins via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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">Hello, hopefully this is the correct place to ask this...<br>
<br>
<br>
We use distcc with clang++ and I have recently added -Wunreachable-code <br>
to our set of warnings.  The problem I am seeing is the compile fails <br>
with (valid) unreachable code warnings on the slave, but passes (no <br>
warning) locally.  All machines have the same compiler version<br>
<br>
clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)<br>
<br>
Distcc takes the compile line, removes -o <output> and replaces it with <br>
-E and sends the preprocessed result to the slave where it is compiled <br>
without any -I, -isystem or -D options. Generating the preprocessed <br>
output and compiling it locally finds the warnings.  I'm concerned that <br>
we are seeing a different result for the output of -E and the standard <br>
compile.<br>
<br>
<br>
The compiler options are:<br>
-g<br>
-Wall<br>
-Werror<br>
-Wno-strict-aliasing<br>
-Wno-missing-braces<br>
-m64<br>
-Wno-switch<br>
-fno-diagnostics-fixit-info<br>
-fshow-overloads=best<br>
-Wno-unknown-warning-option<br>
-Wno-unknown-pragmas<br>
-Wno-logical-op-parentheses<br>
-Wno-tautological-undefined-compare<br>
-Wno-tautological-unsigned-zero-compare<br>
-Wno-tautological-unsigned-enum-zero-compare<br>
-Wno-expansion-to-defined<br>
-Wno-format-security<br>
-Wnarrowing<br>
-Warray-bounds-pointer-arithmetic<br>
-Wduplicate-method-match<br>
-Wmove<br>
-Wunreachable-code<br>
-Wno-return-std-move<br>
-ftemplate-depth=512<br>
-Wpessimizing-move<br>
-gline-tables-only<br>
-fprofile-instr-generate<br>
-fcoverage-mapping<br>
-Og<br>
-std=c++14<br>
-Wno-reorder<br>
-Wno-literal-suffix<br>
-Wcomma<br>
-fPIC<br>
<br>
Thanks,<br>
<br>
Ian.<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>