当前位置: 技术问答>linux和unix
编译时出现的warning,要怎么才能去掉?
来源: 互联网 发布时间:2015-10-08
本文导语: "a.cpp", line 1: Warning: Last line in file "a.h" is not terminated with a newline. "a.cpp", line 2: Warning: Last line in file "hlrFlow.h" is not terminated with a newline. | linux规定文件最后一行必须有回车换...
"a.cpp", line 1: Warning: Last line in file "a.h" is not terminated with a newline.
"a.cpp", line 2: Warning: Last line in file "hlrFlow.h" is not terminated with a newline.
"a.cpp", line 2: Warning: Last line in file "hlrFlow.h" is not terminated with a newline.
|
linux规定文件最后一行必须有回车换行(或则说最后一行必须是空行),因此你在程序最后一行再回车一下就行了。
|
Gcc要求文件最后一行必须有换行
|
程序是怎么写的?
试试这个命令
man dos2unix
试试这个命令
man dos2unix
|
编译时不用开关 -Wall 就可以
不过并不建议
不过并不建议
|
遵守编程规则即可取掉。
|
查看警告类型,用编译器开关屏蔽这类警告
|
我从来都不管warning,赫赫,见笑了。