Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Apr 2008 20:20:53 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-hackers@freebsd.org, hackers@freebsd.org, Romuald Conty <romuald.conty@free.fr>, Romain =?iso-8859-1?Q?Tarti=E8re?= <romain@blogreen.org>
Subject:   Re: indent(1) support for gcc(1) 0b prefix
Message-ID:  <20080427102053.GA7293@server.vk2pj.dyndns.org>
In-Reply-To: <200804270201.53271.max@love2party.net>
References:  <20080426213557.GA88577@marvin.blogreen.org> <200804270201.53271.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--7AUc2qLy4jB3hD7Z
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Apr 27, 2008 at 02:01:53AM +0200, Max Laier wrote:
>On Saturday 26 April 2008 23:35:57 Romain Tarti=E8re wrote:
>> I'm using avr-gcc from the ports and relying on the 0b prefix notation
>> for binary constants, that is:
>>
>> 	foo =3D 0b00101010;
=2E..
>I can't think of a case (outside of "0x...." context) where "...0b..."=20
>would be valid C code, let alone better formated as "...0 b...".  Hence I=
=20
>see no harm in adding your patch to the base indent(1).
>
>Does anyone have an example where "...0 b..." is valid C code?

More relevantly (and excluding avr-gcc) , 0b00101010 is not a valid
token as is, whereas "0 b00101010" may be (if b00101010 is a macro).
By inserting whitespace, indent(1) is changing the syntax of the input
and, IMHO, indent should not be doing that - its brief is to
re-arrange whitespace to (hopefully) improve legibility, not make
syntactic changes.

I would support changing indent to bring its tokenisation more into
line with the C preprocessor.

--=20
Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.

--7AUc2qLy4jB3hD7Z
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.8 (FreeBSD)

iEYEARECAAYFAkgUU4UACgkQ/opHv/APuIe2YACgkL3CFfuvqkw3tXbPQjCC2cc0
jUAAmwS93tXcJN/CJQVbJTDMcIbYRZ5k
=rkOf
-----END PGP SIGNATURE-----

--7AUc2qLy4jB3hD7Z--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080427102053.GA7293>