[poc] buildkernel + clang + -Werror

Dimitry Andric dim at FreeBSD.org
Sat Nov 5 19:14:37 UTC 2011


On 2011-11-05 11:21, Alexander Best wrote:
> i'm sending this mail to the mailinglist simply to prevent my work being list.
> i've experimented with the -Werror and -Wno-error= options and got to the point
> where i was able to compile GENERIC on amd64 with clang:
...

Why don't you just use NO_WERROR?  If you are aiming to simply suppress
warnings, that is a way simpler solution.

The code that causes the warnings should simply be fixed, unless it is
the contrib area, and would make merging harder, or if the warnings are
false positives.

Only in the latter case, and only if clang cannot be fixed right now
(such as with the ?: operator problem), there should be a workaround.
And even then as local as possible, so share/mk/*.mk is not the right
place to add a fix.


> 1) this will only work with clang tot, since the clang version that ships with
>    HEAD atm doesn't understand 'shift-count-negative'; it is being implied by
>    -Werror and cannot be turned off seperately.
> 2) there is a bug in the clang version that ships with HEAD, where -Wno-error=X
>    implies -WX. this is not correct (see gcc(1) man page) and was fixed in
>    clang tot.

I'll have a look if it's possible to import these.  Since head now has
clang from the 3.0 release branch, and the idea is to ship FreeBSD 9.0
with the 3.0 release, or something as close as possible to it, I don't
plan on importing clang trunk anytime soon.


More information about the freebsd-toolchain mailing list