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

next in thread | previous in thread | raw e-mail | index | archive | help
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
> *** [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)
@@ -1945,7 +1945,7 @@
        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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACYV=-G2pxR8x%2Bi3ReajqXH6vHxXh8Ck3AgOQ3%2B8LEJQ_B_ACg>