indent(1) support for gcc(1) 0b prefix
Romain Tartière
romain at blogreen.org
Wed Apr 30 10:48:58 UTC 2008
On Sun, Apr 27, 2008 at 03:38:54PM -0500, Joshua Isom wrote:
> The man page for indent does say "it has a 'forgiving' parser" so I
> don't see why it can't just treat any token starting with a zero as
> special, treat 0b01, 0x0A, 0f4 and 010 as a number regardless of the
> base, even if it doesn't know the base.
I think indent(1) has to check the base in order to split tokens
consistently. Consider the following statements:
read | write | description
--------------+---------------+-----------------------------
42 | 42 | Decimal
42e+3 | 42e+3 | Decimal
042 | 042 | Octal
042e+3 | 042e+3 | Octal?? gcc compiles this but the result
| | looks strange...
0x42 | 0x42 | Hexadecimal
0x42e+3 | 0x42e + 3 | Hexadecimal + Decimal
IMHO, checking numbers base is a requirement for splitting tokens
wisely.
Regards
--
Romain Tartière <romain at blogreen.org> http://romain.blogreen.org/
pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20080430/13ba0d7a/attachment.pgp
More information about the freebsd-hackers
mailing list