对于C推荐GCC警告选项 [英] Recommended gcc warning options for C
本文介绍了对于C推荐GCC警告选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除了-Wall什么其他的警告已发现的人有用?
Other than -Wall what other warnings have people found useful?
<一个href=\"http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html\">http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html
推荐答案
我经常使用的:
gcc -m64 -std=c99 -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual \
-Wstrict-prototypes -Wmissing-prototypes
这集捕获了很多人未使用它(人,他们的code我得到这些标志的第一次编译);它很少给了我一个问题(尽管-Wcast-QUAL偶尔讨厌)。
This set catches a lot for people unused to it (people whose code I get to compile with those flags for the first time); it seldom gives me a problem (though -Wcast-qual is occasionally a nuisance).
这篇关于对于C推荐GCC警告选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文