From owner-freebsd-i386@FreeBSD.ORG Wed Jun 14 08:40:15 2006 Return-Path: X-Original-To: freebsd-i386@hub.freebsd.org Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E55216A41B for ; Wed, 14 Jun 2006 08:40:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EEF843D45 for ; Wed, 14 Jun 2006 08:40:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5E8eEoK095231 for ; Wed, 14 Jun 2006 08:40:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5E8eES9095230; Wed, 14 Jun 2006 08:40:14 GMT (envelope-from gnats) Resent-Date: Wed, 14 Jun 2006 08:40:14 GMT Resent-Message-Id: <200606140840.k5E8eES9095230@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Lukes Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9178A16A41A for ; Wed, 14 Jun 2006 08:34:18 +0000 (UTC) (envelope-from dan@kulesh.obluda.cz) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [195.113.24.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF1B343D48 for ; Wed, 14 Jun 2006 08:34:17 +0000 (GMT) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (openvpn.ms.mff.cuni.cz [195.113.20.87]) by smtp1.kolej.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k5E8YNA1078938 for ; Wed, 14 Jun 2006 10:34:25 +0200 (CEST) (envelope-from dan@kulesh.obluda.cz) Received: from kulesh.obluda.cz (localhost.other [127.0.0.1] (may be forged)) by kulesh.obluda.cz (8.13.6/8.13.6) with ESMTP id k5E8YE8g001503 for ; Wed, 14 Jun 2006 10:34:14 +0200 (CEST) (envelope-from dan@kulesh.obluda.cz) Received: (from root@localhost) by kulesh.obluda.cz (8.13.6/8.13.6/Submit) id k5E8YDN8001502; Wed, 14 Jun 2006 10:34:13 +0200 (CEST) (envelope-from dan) Message-Id: <200606140834.k5E8YDN8001502@kulesh.obluda.cz> Date: Wed, 14 Jun 2006 10:34:13 +0200 (CEST) From: Dan Lukes To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: i386/98932: [ PATCH ] Kernel compilation failed on specific PERFMON configuration X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Lukes List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 08:40:15 -0000 >Number: 98932 >Category: i386 >Synopsis: [ PATCH ] Kernel compilation failed on specific PERFMON configuration >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 14 08:40:13 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Dan Lukes >Release: FreeBSD 6.1-STABLE i386 >Organization: Obludarium >Environment: System: FreeBSD 6.1-STABLE #4: Mon May 29 15:29:58 CEST 2006 i386 sys/i386/isa/prof_machdep.c,v 1.25 2005/05/20 17:16:24 njl >Description: In the sys/i386/isa/prof_machdep.c The variables cputime_clock_pmc_conf,cputime_clock_pmc_init,saved_gmp are declared when I586_PMC_GUPROF defined, but in the actual code, they are used when I586_PMC_GUPROF AND PERFMON defined only. It cause ... /usr/src/sys/i386/isa/prof_machdep.c:66 warning: 'cputime_clock_pmc_conf' defined but not used /usr/src/sys/i386/isa/prof_machdep.c:67 warning: 'cputime_clock_pmc_init' defined but not used /usr/src/sys/i386/isa/prof_machdep.c:67 warning: 'saved_gmp' defined but not used ... warning during compilation. As "count warning as error" is in efect for compilation (unless NO_WERROR defined) the compilation will fail. >How-To-Repeat: Add I586_PMC_GUPROF but no PERFMON to kernel configuration file. Try to compile kernel. >Fix: There are several possible ways to fix it. 1. We can declare there has no reason to use I586_PMC_GUPROF without PERFMON, so it's administrator's error. 2. We can add __unused to variable declaration 3. We can declare variables only when used later. Althought [1] seems to be true, I recommend [3]: --- sys/i386/isa/prof_machdep.c.ORIG Wed Jun 14 10:15:18 2006 +++ sys/i386/isa/prof_machdep.c Wed Jun 14 10:20:34 2006 @@ -62,7 +62,7 @@ int cputime_bias = 1; /* initialize for locality of reference */ static int cputime_clock = CPUTIME_CLOCK_UNINITIALIZED; -#ifdef I586_PMC_GUPROF +#if defined(PERFMON) && defined(I586_PMC_GUPROF) static u_int cputime_clock_pmc_conf = I586_PMC_GUPROF; static int cputime_clock_pmc_init; static struct gmonparam saved_gmp; >Release-Note: >Audit-Trail: >Unformatted: