From owner-freebsd-current@FreeBSD.ORG Mon Jan 17 18:56:18 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7009106564A for ; Mon, 17 Jan 2011 18:56:18 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 27D118FC08 for ; Mon, 17 Jan 2011 18:56:17 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1B78C9CB0D2 for ; Mon, 17 Jan 2011 19:56:16 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KPd0uz5Oo+Ew for ; Mon, 17 Jan 2011 19:56:15 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 481979CB1A9 for ; Mon, 17 Jan 2011 19:56:15 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p0HIuFCQ064744 for current@freebsd.org; Mon, 17 Jan 2011 19:56:15 +0100 (CET) (envelope-from rdivacky) Date: Mon, 17 Jan 2011 19:56:15 +0100 From: Roman Divacky To: current@freebsd.org Message-ID: <20110117185615.GA64182@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: [RFC]: tautological compares in amd64 GENERIC X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 17 Jan 2011 18:56:18 -0000 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable hi, clang found these problems in our amd64 GENERIC: some of these may be real bugs lurking in our code - can the respective own= ers of the subsystems take a look? The bugs cover all areas from ufs/vm to=20 net*/security. Thank you! roman cam/cam_periph.c:530:28: warning: comparison of unsigned expression < 0 is = always false [-Wtautological-compare] else if (periph->refcount < 0) ~~~~~~~~~~~~~~~~ ^ ~ kern/uipc_syscalls.c:347:16: warning: comparison of unsigned expression < 0= is always false [-Wtautological-compare] if (*namelen < 0) ~~~~~~~~ ^ ~ kern/uipc_syscalls.c:1472:12: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (*alen < 0) ~~~~~ ^ ~ kern/uipc_syscalls.c:1572:12: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (*alen < 0) ~~~~~ ^ ~ ufs/ffs/ffs_inode.c:538:24: warning: comparison of unsigned expression < 0 = is always false [-Wtautological-compare] if (DIP(ip, i_blocks) < 0) /* sanity */ ~~~~~~~~~~~~~~~~~ ^ ~ ufs/ufs/ufs_quota.c:329:44: warning: comparison of unsigned expression >=3D= 0 is always true [-Wtautological-compare] if (dq->dq_curinodes !=3D 0 && ncurinodes >=3D 0) ~~~~~~~~~~ ^ ~ ufs/ufs/ufs_quota.c:367:21: warning: comparison of unsigned expression >=3D= 0 is always true [-Wtautological-compare] ncurinodes >=3D 0) ~~~~~~~~~~ ^ ~ vm/vm_pageout.c:1701:14: warning: comparison of unsigned expression >=3D 0 = is always true [-Wtautological-compare] if (limit >=3D 0 && size >=3D limit) { ~~~~~ ^ ~ amd64/amd64/sys_machdep.c:562:16: warning: comparison of unsigned expressio= n < 0 is always false [-Wtautological-compare] uap->num < 0 || largest_ld > max_ldt_segment) ~~~~~~~~ ^ ~ netinet6/in6_mcast.c:1849:30: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (mreq.ipv6mr_interface < 0 || ~~~~~~~~~~~~~~~~~~~~~ ^ ~ netinet6/in6_mcast.c:2196:15: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (ifindex < 0 || V_if_index < ifindex) ~~~~~~~ ^ ~ netinet6/in6_mcast.c:2354:14: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (ifindex < 0 || V_if_index < ifindex) ~~~~~~~ ^ ~ netinet6/ip6_output.c:2542:29: warning: comparison of unsigned expression <= 0 is always false [-Wtautological-compare] pktinfo->ipi6_ifindex < 0) { ~~~~~~~~~~~~~~~~~~~~~ ^ ~ netinet6/scope6.c:391:15: warning: comparison of unsigned expression < 0 is= always false [-Wtautological-compare] if (zoneid < 0 || V_if_index < zoneid) ~~~~~~ ^ ~ security/audit/audit_syscalls.c:306:39: warning: comparison of unsigned exp= ression < 0 is always false [-Wtautological-compare] (udata.au_qctrl64.aq64_minfree < 0) || security/mac/mac_framework.c:589:20: warning: comparison of unsigned expres= sion < 0 is always false [-Wtautological-compare] if (mac->m_buflen < 0 || ~~~~~~~~~~~~~ ^ ~ dev/acpica/acpi_pci.c:284:24: warning: comparison of unsigned expression < = 0 is always false [-Wtautological-compare] if (pcib_get_bus(dev) < 0) ~~~~~~~~~~~~~~~~~ ^ ~ dev/buslogic/bt.c:978:16: warning: comparison of unsigned enum expression >= =3D 0 is always true [-Wtautological-compare] if (bio_index >=3D 0 && bio_index < BT_NUM_ISAPORTS) ~~~~~~~~~ ^ ~ dev/cs/if_cs.c:367:12: warning: comparison of unsigned expression >=3D 0 is= always true [-Wtautological-compare] if (irq >=3D 0 || irq < 16) ~~~ ^ ~ dev/sym/sym_hipd.c:3449:10: warning: comparison of unsigned expression < 0 = is always false [-Wtautological-compare] if (fak < 0) {fak =3D 0; ret =3D -1;} ~~~ ^ ~ dev/usb/serial/usb_serial.c:1056:18: warning: comparison of unsigned expres= sion < 0 is always false [-Wtautological-compare] if (t->c_ospeed < 0) { ~~~~~~~~~~~ ^ ~ --LQksG6bCIzRHxTLp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAk00kM8ACgkQLVEj6D3CBEyugQCfZDDRaJwG1HKH6tJH1s5cZoHx czYAmwRi5mW8I8Odgt0com6VZgWkJZNc =m5JP -----END PGP SIGNATURE----- --LQksG6bCIzRHxTLp--