[llvm-dev] Potential problem with -Wunreachable-code

Ian Collins via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 21 23:09:38 PST 2019

On 22/11/2019 16:40, David Blaikie wrote:
> 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.
> 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.

Interesting, thanks.

It does make using clang with distcc somewhat problematic, especially 
given the errors aren't spotted in the "normal" build. This ends up 
causing users to think there's an issue with the distcc slaves (there 
are may instances in our code where the bugs are only spotted in the 
preprocessed output).



More information about the llvm-dev mailing list