indent(1) support for gcc(1) 0b prefix

Peter Jeremy peterjeremy at optushome.com.au
Sun Apr 27 10:23:41 UTC 2008


On Sun, Apr 27, 2008 at 02:01:53AM +0200, Max Laier wrote:
>On Saturday 26 April 2008 23:35:57 Romain Tartière wrote:
>> I'm using avr-gcc from the ports and relying on the 0b prefix notation
>> for binary constants, that is:
>>
>> 	foo = 0b00101010;
...
>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...".  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?

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.

-- 
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.
-------------- 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/20080427/6309b9b5/attachment-0001.pgp


More information about the freebsd-hackers mailing list