From owner-svn-src-all@FreeBSD.ORG Sun Oct 27 19:00:05 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id BBEE2235; Sun, 27 Oct 2013 19:00:05 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9184726D0; Sun, 27 Oct 2013 19:00:05 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VaVZE-000AW7-88; Sun, 27 Oct 2013 19:00:04 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r9RJ01BM049063; Sun, 27 Oct 2013 13:00:01 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+LJe1yEW18A+xCjswA3liE Subject: Re: svn commit: r257203 - head/sys/arm/arm From: Ian Lepore To: Bruce Evans In-Reply-To: <20131028040222.G929@besplex.bde.org> References: <201310270329.r9R3Tcoi076809@svn.freebsd.org> <20131028040222.G929@besplex.bde.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 27 Oct 2013 13:00:01 -0600 Message-ID: <1382900401.1170.227.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Oct 2013 19:00:05 -0000 On Mon, 2013-10-28 at 04:42 +1100, Bruce Evans wrote: > On Sun, 27 Oct 2013, Ian Lepore wrote: > > > Log: > > Eliminate a compiler warning about extraneous parens. > > Wow, what flags give these warnings? --- busdma_machdep.o --- /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((map->pagesneeded == 0)) { ~~~~~~~~~~~~~~~~~^~~~ /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: remove extraneous parentheses around the comparison to silence this warning if ((map->pagesneeded == 0)) { ~ ^ ~ /local/build/staging/freebsd/dp10/src/sys/arm/arm/busdma_machdep.c:811:24: note: use '=' to turn this equality comparison into an assignment if ((map->pagesneeded == 0)) { ^~ = That's what the compiler had to say about it. I guess in somebody's mind if it's a probable error to have done if (testandassign = something) and somehow it's less probably an error to have done if ((testandassign = something)) then surely the converse must also be true and double parens not syntactically necessary in either case must be indicative of error in one of the cases. The warning doesn't bother me as much as the two useless notes that follow it (which are annoying when combined with my editor's feature of parsing compiler output and jumping to the next error point in the code). I've notice clang is particularly chatty, with things like suggesting what you might have meant when you spell a variable name wrong. Before long it's going to be like RPG and COBOL where it's willing to assume what you meant and try to generate runnable code in the face of almost any error. I probably date myself with references to RPG and COBOL, but it does bring back fond memories of slapping a boilerplate header on every interoffice memo issued by management and running it through the cobol compiler, and grading them on whether their memos generated runnable code or so many errors the compiler gave up. -- Ian