Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当在以下代码上使用 GNU 缩进(至少版本 2.2.6 和 2.2.10)时...
void main () { int i = 0b01010101; }
它将被重新格式化为...
void main () { int i = 0 b01010101; }
缩进中是否有任何选项可以避免这种行为?
我在缩进邮件列表中得到了这个问题的答案:
没有意图不支持 C 派生词:该构造不是 C。
使用 '0b' 前缀的二进制常量只是 gcc 的扩展。
#!/bin/sh indent | sed -r 's/(0) (b[01]+)/\1\2/g'