From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 27 01:07:35 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 123D11065673; Sun, 27 Apr 2008 01:07:35 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from smtpoutm.mac.com (smtpoutm.mac.com [17.148.16.80]) by mx1.freebsd.org (Postfix) with ESMTP id ED24B8FC0A; Sun, 27 Apr 2008 01:07:34 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from mac.com (asmtp007-s [10.150.69.70]) by smtpoutm.mac.com (Xserve/smtpout017/MantshX 4.0) with ESMTP id m3R0lu5D003024; Sat, 26 Apr 2008 17:47:56 -0700 (PDT) Received: from [192.168.1.100] (209-128-86-226.bayarea.net [209.128.86.226]) (authenticated bits=0) by mac.com (Xserve/asmtp007/MantshX 4.0) with ESMTP id m3R0lsiS017508 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 26 Apr 2008 17:47:54 -0700 (PDT) Message-Id: <5E2E3A08-A12E-4AF6-893D-20A44AC205AF@mac.com> From: Marcel Moolenaar To: Max Laier In-Reply-To: <200804270201.53271.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Date: Sat, 26 Apr 2008 17:47:54 -0700 References: <20080426213557.GA88577@marvin.blogreen.org> <200804270201.53271.max@love2party.net> X-Mailer: Apple Mail (2.919.2) Cc: freebsd-hackers@freebsd.org, hackers@freebsd.org, Romuald Conty , =?ISO-8859-1?Q?Romain_Tarti=E8re?= Subject: Re: indent(1) support for gcc(1) 0b prefix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Apr 2008 01:07:35 -0000 On Apr 26, 2008, at 5:01 PM, Max Laier wrote: > On Saturday 26 April 2008 23:35:57 Romain Tarti=E8re wrote: >> Hello FreeBSD hackers! >> >> I'm using avr-gcc from the ports and relying on the 0b prefix =20 >> notation >> for binary constants, that is: >> >> foo =3D 0b00101010; >> >> Thanks to /usr/ports/devel/avr-gcc/files/patch-0b-constants this is >> possible :-) >> >> But I would like to use indent(1) to reformat contributed code >> automatically. Unfortunately, the 0b notation is not supported by =20 >> that >> program, and the resulting code looks like this: >> >> foo =3D 0 b00101010; >> >> ... then compilation fails, bla bla bla... > > I can't think of a case (outside of "0x...." context) where "...0b..." > would be valid C code, let alone better formated as "...0 b...". =20 > Hence I > see no harm in adding your patch to the base indent(1). > > Does anyone have an example where "...0 b..." is valid C code? Well, if b... is a preprocessor define then you can easily come up with valid C: #define b... *2 then: ...0 b... becomes: ...0 *2 That's a valid expression in the right context... FYI, --=20 Marcel Moolenaar xcllnt@mac.com