1
这是我makefile
:缩进增加了额外的常量为const方法
TRASH = *.o complex *~
complex: test.o complex.o
g++ -Wall -o [email protected] $^
test.o: test.cpp complex.hpp
g++ -Wall -c -o [email protected] $<
complex.o: complex.cpp complex.hpp
g++ -Wall -c -o [email protected] $<
PHONY: clean beauty
clean:
rm -f $(TRASH)
beauty:
indent -npsl -brf -cdb test.cpp complex.cpp complex.hpp
我缩进选项格式代码:
int function() {
/*
Comments
*/
}
问题:
如果我有一些C++功能有原型:Complex method_name(arguments) const;
每当我使用make beauty
的.cpp
文件我一个理由,它增加了一个更加const
,和我的函数变成这样:
Complex method_name(arguments) const const {
/*
Comments
*/
}
注:头文件缩进就好了,但就像我上面描述.cpp
文件缩进。
有谁知道这可能是什么原因?
这个问题与'make'没有任何关系,但是使用'indent'程序。它看起来像'indent'中的一个bug对我有用。 –
[这是关于GNU indent的bug报告](https://lists.gnu.org/archive/html/bug-indent/2014-05/msg00004.html)。不过,它似乎并没有在邮件列表线程中清楚地解决。 :| – unwind
谢谢你们,我一整天都在想这个! –