C的推荐gcc警告选项 [英] Recommended gcc warning options for C
本文介绍了C的推荐gcc警告选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
除了 - 是否有其他警告有人觉得有用吗?
Other than -Wall what other warnings have people found useful?
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
这个集合捕获了很多未被使用的人(他们的代码,我第一次用这些标志编译);它很少给我一个问题(虽然-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屋!
查看全文