[cfe-dev] Clang + ccache == different warnings?

Larry Gritz lg at larrygritz.com
Fri Jun 1 12:08:42 PDT 2012


After compiling my apps with clang 3.1, and fixing all the new warnings it found that gcc did not care about, I wanted to get clang + ccache working together.  I set up a bash script "~/bin/clang" that looks like this:

	#!/bin/bash
	ccache /opt/local/bin/clang $@

Obviously this just calls ccache with the clang path and arguments.  The surprising thing is that when I invoke clang this way, several classes of warnings are flagged that were not noticed when I ran /opt/local/bin/clang.

The above example is on OS X, where I've installed clang 3.1 via Macports.  But I've reproduced the same effect on Linux using clang/llvm that I compiled from the svn (3.1 branch) as well.

Is this expected behavior?  Does anybody have an explanation for what's going on here?

--
Larry Gritz
lg at larrygritz.com






More information about the cfe-dev mailing list