Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 2015 02:10:16 -0700
From:      Eitan Adler <lists@eitanadler.com>
To:        Craig Rodrigues <rodrigc@freebsd.org>
Cc:        freebsd-current Current <freebsd-current@freebsd.org>,  "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>,  FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   Re: [Request for Help] Reducing gcc 4.9 compilation warnings
Message-ID:  <CAF6rxgnp4c=shS9fc7ijHxqKvgz09vX_ja8dWf%2B2NbjCOvBhiQ@mail.gmail.com>
In-Reply-To: <CAG=rPVetxeXcVAB7ripkMtEYGB3Fw18JZH3XpOnRqEf6nvmXdQ@mail.gmail.com>
References:  <CAG=rPVetxeXcVAB7ripkMtEYGB3Fw18JZH3XpOnRqEf6nvmXdQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"

On 18 April 2015 at 11:12, Craig Rodrigues <rodrigc@freebsd.org> wrote:
> Hi,
>
> After the latest commits by members of freebsd-toolchain@ ,
> I have managed to compile latest CURRENT world and GENERIC
> kernel on amd64 with an gcc 4.9 external toolchain by doing:
>
>    pkg install devel/amd64-xtoolchain-gcc
>    cd /usr/src
>    sed -i "" -e 's/boot2//' sys/boot/i386/Makefile
>    make buildworld CROSS_TOOLCHAIN=amd64-gcc NO_WERROR=yes WERROR=
>    make buildkernel CROSS_TOOLCHAIN=amd64-gcc NO_WERROR=yes WERROR=
>
>
> It was necessary to skip boot2 from building because of errors
> reported here:
> https://lists.freebsd.org/pipermail/freebsd-toolchain/2015-April/001658.html
>
> The boot2 compilation errors still need to be worked on.
>
> However, most other things compile with warnings.  If folks are
> interested in looking at the warnings, you can see them here:
>
> https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc4.9/warnings17
>
> Please look at these warnings, and if you see places to
> patch the code to eliminate the warnings, please submit patches
> and commit them if you can.

Some time ago I tried to do something similar, but with gcc4.6 instead
of gcc4.9.

The vast majority of warnings (1548) are "unused-but-set-variable" and
it may be worthwhile to just silence this warning, at least at low
WARNS levels.  It has caught real errors but is quite noisy and can
cause quite a bit of churn.

"inline" (count 515) is generally pure noise, and I think we should
disable it.  It can be helpful to find certain types of performance
optimizations, but it should be opt-in.

"strict-aliasing" (154) are likely all real bugs of some form.  Very
few exist in contrib code, and it would be good to fix them.

"Warning" (111) seem to be a mix of warnings, but mostly in contrib code.

"maybe-uninitialized" (111) is often noisy, and in a spot check were
all false positives.

"deprecated-declarations" (22) is all in contrib code

Many of these are useful though and I've already fixed a few of the
bugs reported.

Perhaps it would be useful to do a second run of this, but with a
modified share/mk to silence the most useless of these warnings?

-- 
Eitan Adler



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxgnp4c=shS9fc7ijHxqKvgz09vX_ja8dWf%2B2NbjCOvBhiQ>