Re: Kernel build error in hwpmc with system GNU cc

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Thu, 02 May 2013 15:10:10 +0200
On 2013-05-02 12:06, Davide Italiano wrote:
> On Thu, May 2, 2013 at 8:43 AM, Andrey Chernov <ache_at_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.
Received on Thu May 02 2013 - 11:10:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:37 UTC