From owner-freebsd-current@FreeBSD.ORG Tue Oct 22 08:47:25 2013 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AC6975A2; Tue, 22 Oct 2013 08:47:25 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7BC28D5; Tue, 22 Oct 2013 08:47:24 +0000 (UTC) Received: from [192.168.0.2] (cpc27-cmbg15-2-0-cust235.5-4.cable.virginmedia.com [86.27.188.236]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r9M8lGPF044735 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 Oct 2013 08:47:18 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: gperf/src/options.cc -- quiesce clang warnings -Wlogical-op-parentheses From: David Chisnall In-Reply-To: <1382399026.7749.3.camel@localhost> Date: Tue, 22 Oct 2013 09:47:11 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0744E30D-89EF-4340-A7DC-968AC27F302B@FreeBSD.org> References: <1382327452.2610.5.camel@localhost> <1382399026.7749.3.camel@localhost> To: sbruno@FreeBSD.org X-Mailer: Apple Mail (2.1508) Cc: Matthew Fleming , "freebsd-current@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Tue, 22 Oct 2013 08:47:25 -0000 On 22 Oct 2013, at 00:43, Sean Bruno wrote: > Heh, Matthew suggested the obvious in private mail, it seems that this > would be better "spelled" as "isalpha" :-) This looks wrong. The behaviour of isalpha() depends on the current = locale. You probably want isalpha_l(), with the "C" locale. David > Index: contrib/gperf/src/options.cc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- contrib/gperf/src/options.cc (revision 256865) > +++ contrib/gperf/src/options.cc (working copy) > @@ -281,7 +281,7 @@ > { > putchar (*arg); > arg++; > - if (*arg >=3D 'A' && *arg <=3D 'Z' || *arg >=3D 'a' && *arg = <=3D 'z') > + if (isalpha(*arg)) > { > putchar (*arg); > arg++; > @@ -293,7 +293,7 @@ > putchar (*arg); > arg++; > } > - while (*arg >=3D 'A' && *arg <=3D 'Z' || *arg >=3D 'a' = && *arg > <=3D 'z' || *arg =3D=3D '-'); > + while (isalpha(*arg) || *arg =3D=3D '-'); > if (*arg =3D=3D '=3D') > { > putchar (*arg);