From owner-freebsd-current@FreeBSD.ORG Sat Apr 11 16:41:58 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48EB4C0A; Sat, 11 Apr 2015 16:41:58 +0000 (UTC) Received: from st11p00mm-asmtp001.mac.com (st11p00mm-asmtpout001.mac.com [17.172.81.0]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BDB0A24; Sat, 11 Apr 2015 16:41:57 +0000 (UTC) Received: from akita.localnet (c-73-162-13-215.hsd1.ca.comcast.net [73.162.13.215]) by st11p00mm-asmtp001.mac.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 2014)) with ESMTPSA id <0NMN00J72IDSJK20@st11p00mm-asmtp001.mac.com>; Sat, 11 Apr 2015 16:41:56 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-04-11_02:2015-04-10,2015-04-11,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=4 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1412110000 definitions=main-1504110133 From: Rui Paulo To: freebsd-current@freebsd.org Subject: Re: WARNING: FOO.c: enum pmc_event has too many values: 1930 > 1023 Date: Sat, 11 Apr 2015 09:41:47 -0700 Message-id: <3993727.Uyr34jnAqW@akita> User-Agent: KMail/4.14.3 (FreeBSD/11.0-CURRENT; KDE/4.14.3; amd64; ; ) In-reply-to: References: MIME-version: 1.0 Content-transfer-encoding: 7Bit Content-type: text/plain; charset=us-ascii X-Mailman-Approved-At: Sat, 11 Apr 2015 17:09:32 +0000 Cc: current@freebsd.org, Oliver Pinter X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Apr 2015 16:41:58 -0000 On Saturday 11 April 2015 15:53:41 Oliver Pinter wrote: > Hi all! > > I just found the line in the subject in our jenkinsbuild log in both > amd64 and i386 case (we don't modified these files): > > http://nyi-01.build.hardenedbsd.org:8180/jenkins/job/HardenedBSD-master-i386 > /56/console > http://nyi-01.build.hardenedbsd.org:8180/jenkins/job/HardenedBSD-master-amd > 64/58/consoleFull > > And more similar lines: > > WARNING: kern_pmc.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: kern_rwlock.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: kern_sx.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: kern_clock.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: kern_mutex.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: trap.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_soft.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_intel.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_amd.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_tsc.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_x86.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_logging.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_piv.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_uncore.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_core.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: hwpmc_mod.c: enum pmc_event has too many values: 1930 > 1023 > WARNING: kern_lock.c: enum pmc_event has too many values: 1930 > 1023 This is a known problem. PMC abuses enums and CTF can't cope with it. > and some other hwpmc related warnings too: > --- kern_pmc.o --- > /jenkins/workspace/HardenedBSD-master-amd64/sys/kern/kern_pmc.c:290:32: > warning: comparison of constant 131072 with expression of type 'enum > pmc_event' is always false > [-Wtautological-constant-out-of-range-compare] > KASSERT(ps->ps_ev.pm_ev_code >= PMC_EV_SOFT_FIRST && > ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/systm.h:84:24: > note: expanded from macro 'KASSERT' > if (__predict_false(!(exp))) \ > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/cdefs.h:453:51: > note: expanded from macro '__predict_false' > #define __predict_false(exp) __builtin_expect((exp), 0) > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/kern/kern_pmc.c:291:28: > warning: comparison of constant 135167 with expression of type 'enum > pmc_event' is always true > [-Wtautological-constant-out-of-range-compare] > ps->ps_ev.pm_ev_code <= PMC_EV_SOFT_LAST, > ~~~~~~~~~~~~~~~~~~~~ ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/systm.h:84:24: > note: expanded from macro 'KASSERT' > if (__predict_false(!(exp))) \ > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/cdefs.h:453:51: > note: expanded from macro '__predict_false' > #define __predict_false(exp) __builtin_expect((exp), 0) > ^ > --- kern_prot.o --- > --- kern_pmc.o --- > /jenkins/workspace/HardenedBSD-master-amd64/sys/kern/kern_pmc.c:307:13: > warning: comparison of constant 131072 with expression of type 'enum > pmc_event' is always false > [-Wtautological-constant-out-of-range-compare] > KASSERT(ev >= PMC_EV_SOFT_FIRST && > ~~ ^ ~~~~~~~~~~~~~~~~~ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/systm.h:84:24: > note: expanded from macro 'KASSERT' > if (__predict_false(!(exp))) \ > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/cdefs.h:453:51: > note: expanded from macro '__predict_false' > #define __predict_false(exp) __builtin_expect((exp), 0) > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/kern/kern_pmc.c:308:9: > warning: comparison of constant 135167 with expression of type 'enum > pmc_event' is always true > [-Wtautological-constant-out-of-range-compare] > ev <= PMC_EV_SOFT_LAST, > ~~ ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/systm.h:84:24: > note: expanded from macro 'KASSERT' > if (__predict_false(!(exp))) \ > ^ > /jenkins/workspace/HardenedBSD-master-amd64/sys/sys/cdefs.h:453:51: > note: expanded from macro '__predict_false' > #define __predict_false(exp) __builtin_expect((exp), 0) We kept these checks for safety. -- Rui Paulo