Re: Kernel build error in hwpmc with system GNU cc

From: Davide Italiano <davide_at_freebsd.org>
Date: Thu, 2 May 2013 12:06:34 +0200
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
> *** [hwpmc_core.o] Error code 1
>
> --
> bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N

You can find a patch attached at the end of this mail that should fix
the problem.
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.


Index: sys/dev/hwpmc/hwpmc_core.c
===================================================================
--- sys/dev/hwpmc/hwpmc_core.c  (revision 250174)
+++ sys/dev/hwpmc/hwpmc_core.c  (working copy)
_at__at_ -1945,7 +1945,7 _at__at_
        caps = a->pm_caps;
        if ((IAP_PMC_CAPS & caps) != caps)
                return (EPERM);
-
+       map = 0;        /* XXX: silent GCC warning */
        arch = iap_is_event_architectural(pm->pm_event, &map);
        if (arch == EV_IS_ARCH_NOTSUPP)
                return (EOPNOTSUPP);

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
Received on Thu May 02 2013 - 08:06:35 UTC

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