When GNU indent (at least version 2.2.6 and 2.2.10) is used on the following code...
void
main ()
{
int i = 0b01010101;
}
it wi开发者_如何学编程ll be reformatted into this ...
void
main ()
{
int i = 0 b01010101;
}
Is there any option in indent that avoids this behavior?
I got an answer to this question on the indent mailing list:
No intent doesn't support C derivatives: that construct isn't C.
The Binary constants using the `0b' prefix is just an extension of gcc.
#!/bin/sh
indent | sed -r 's/(0) (b[01]+)/\1\2/g'
精彩评论