From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 21:57:54 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 11F3D106566B for ; Sat, 26 Apr 2008 21:57:54 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from postfix2-g20.free.fr (postfix2-g20.free.fr [212.27.60.43]) by mx1.freebsd.org (Postfix) with ESMTP id 896E98FC0C for ; Sat, 26 Apr 2008 21:57:53 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by postfix2-g20.free.fr (Postfix) with ESMTP id E63C125B6A3B for ; Sat, 26 Apr 2008 21:35:33 +0200 (CEST) Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 518AF17B540; Sat, 26 Apr 2008 23:35:58 +0200 (CEST) Received: from marvin.blogreen.org (marvin.blogreen.org [82.247.213.140]) by smtp3-g19.free.fr (Postfix) with ESMTP id 0ADAB17B530; Sat, 26 Apr 2008 23:35:58 +0200 (CEST) Received: by marvin.blogreen.org (Postfix, from userid 1001) id B20AF5C059; Sat, 26 Apr 2008 23:35:57 +0200 (CEST) Date: Sat, 26 Apr 2008 23:35:57 +0200 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: hackers@freebsd.org Message-ID: <20080426213557.GA88577@marvin.blogreen.org> Mail-Followup-To: hackers@freebsd.org, Romuald Conty Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://romain.blogreen.org/pubkey.asc X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Romuald Conty Subject: 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: Sat, 26 Apr 2008 21:57:54 -0000 --LpQ9ahxlCli8rRTG Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello FreeBSD hackers! I'm using avr-gcc from the ports and relying on the 0b prefix 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 that program, and the resulting code looks like this: foo =3D 0 b00101010; =2E.. then compilation fails, bla bla bla... A quick look at indent(1) source code leaded me to tweak /usr/src/usr.bin/indent/lexi.c so that the 0b notation is supported (patch attached). I was so wondering how useful(less) it was to support this extension in FreeBSD indent(1) program. The version of gcc provided with the base system does not support this syntax, and AFAIK, only the avr-gcc port support this kind of constructs... So options are: - Add support for 0b notation to FreeBSD indent(1) (maybe requiring the use of an extra command line argument to support this feature); - Provide a patch for indent(1) that can be conditionally applied on the code when compiling the world; - Create another port, say avr-indent(1), that is not more than a copy of indent(1) with support of 0b constructs; - Do nothing: tweaking indent(1) for supporting this is so trivial that the few individuals interested in this can have their local version of indent. Can you please tell me your opinion about this? Thank you in advance, Romain PS: I also took a look at GNU indent (gindent(1) from the ports), but it does not support 0b notation too. --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --2oS5YaxWCcQjTEyO-- --LpQ9ahxlCli8rRTG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkgToD0ACgkQ2OmjP/9W/0O6ogCeOxVteaXp7Gs/yVdVrIiEj2zD aL8Anj7kyGvF5b8qLrRn30k+fRjBsWQj =yhc5 -----END PGP SIGNATURE----- --LpQ9ahxlCli8rRTG--