Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2013 15:10:10 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Davide Italiano <davide@freebsd.org>,  Andrey Chernov <ache@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: Kernel build error in hwpmc with system GNU cc
Message-ID:  <518265B2.40704@FreeBSD.org>
In-Reply-To: <CACYV=-G2pxR8x%2Bi3ReajqXH6vHxXh8Ck3AgOQ3%2B8LEJQ_B_ACg@mail.gmail.com>
References:  <51820AFD.1030607@freebsd.org> <CACYV=-G2pxR8x%2Bi3ReajqXH6vHxXh8Ck3AgOQ3%2B8LEJQ_B_ACg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2013-05-02 12:06, Davide Italiano wrote:
> On Thu, May 2, 2013 at 8:43 AM, Andrey Chernov <ache@freebsd.org> wrote:
>> cc1: warnings being treated as errors
>> /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_core.c: In function 'iap_allocate_pmc':
>> /usr/src/sys/modules/hwpmc/../../dev/hwpmc/hwpmc_core.c:1935: warning: 'map' may be used uninitialized in this function
...
> You can find a patch attached at the end of this mail that should fix
> the problem.

Hm, the warning seems to be bogus.  Newer versions of gcc (I tried 4.7.3
and 4.8.1) do not warn about 'map' (though they both warn about another
variable, which is set, but not used.)


> More generally speaking, why are you building -CURRENT using GCC while
> the default compiler has been clang since November 2012?
> I understand we cannot completely get rid of GCC as long as
> Tier-2/Tier-3 arch haven't full support for clang and friends, OTOH, I
> see clang default on amd64 so I guess at some point we should declare
> GCC not officially supported anymore. Putting the additional burden of
> testing on the committer because two compilers are supported at the
> same time doesn't scale really well, at least according to me.

Some people still prefer gcc, and while this warning is a bit annoying,
I see no problem in putting in a workaround.  Using gcc for arches which
default to clang will most likely have to be supported for quite some
time.

Also, if the external toolchain support ever comes off the ground, it
will probably become necessary to suppress certain warnings on an
individual basis; for example, with recent gcc versions, there are quite
a large number of "variable x set but not used" warnings, which are not
very useful, most of the time.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?518265B2.40704>