用于确定需要/不需要哪些标头的工具? [英] Tool to determine which headers are needed/not_needed?
问题描述
有没有人知道一个(希望是免费的)工具可以遍历
项目并确定
中不需要或不需要哪个#include .C文件?这将有助于删除多余和/或不必要的标题包含物
。
谢谢!
Does anyone know of a (hopefully free) tool that can traverse a
project and determine which "#include"s are not needed or needed in
every .C file? This would be helpful in removing header inclusions
that are redundant and/or unnecessary.
Thanks!
推荐答案
C_guy写道:
C_guy wrote:
>
有谁知道一个(希望是免费的)工具可以遍历一个
项目并确定每个.C文件中不需要或不需要哪个#include
?这将有助于删除冗余和/或不必要的标题
包含。
>
Does anyone know of a (hopefully free) tool that can traverse a
project and determine which "#include"s are not needed or needed
in every .C file? This would be helpful in removing header
inclusions that are redundant and/or unnecessary.
使用您的编辑器。注释掉#include语句。重新编译。如果
没有出现错误,那么该语句就可以了。如果出现错误,请删除
评论。重复。
-
[邮件]:Chuck F(cinefalconer at maineline dot net)
[page]:< ; http://cbfalconer.home.att.net>
尝试下载部分。
Use your editor. Comment out a #include statement. Recompile. If
no errors appear, that statement can go. If errors appear, remove
the comment. Repeat.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
2008年9月10日星期三08:10 :56 -0700(PDT),C_guy< er ******* @ gmail.com>
写道:
On Wed, 10 Sep 2008 08:10:56 -0700 (PDT), C_guy <er*******@gmail.com>
wrote:
>有没有人知道一个(希望是免费的)工具可以遍历
项目并确定每个.C文件中不需要或不需要哪些#include?这将有助于删除多余和/或不必要的标题包含。
>Does anyone know of a (hopefully free) tool that can traverse a
project and determine which "#include"s are not needed or needed in
every .C file? This would be helpful in removing header inclusions
that are redundant and/or unnecessary.
如果你从no开始,编译器会告诉每次它b / b
遇到标题中的内容。在
时加一个,直到诊断消失。
除了相当小的时间罚款,包括一个不必要的
头或者两个通常不会引起问题。
-
删除电子邮件的del
If you start with none, the compiler will tell every time it
encounters something that would have been in a header. Add one at a
time till the diagnostics disappear.
Other than a pretty small time penalty, including an unnecessary
header or two usually doesn''t cause problems.
--
Remove del for email
2008年9月10日星期三08:10:56 -0700(PDT),C_guy< er ******* @ gmail.com>
在comp.lang.c中写道:
On Wed, 10 Sep 2008 08:10:56 -0700 (PDT), C_guy <er*******@gmail.com>
wrote in comp.lang.c:
有没有人知道一个(希望是免费的)工具可以遍历
项目并确定哪个#include不是每个.C文件需要或需要
?这将有助于删除多余和/或不必要的标题包含
。
Does anyone know of a (hopefully free) tool that can traverse a
project and determine which "#include"s are not needed or needed in
every .C file? This would be helpful in removing header inclusions
that are redundant and/or unnecessary.
我看到你已经得到了一些评论的建议和
寻找错误的思想学派,这确实有效但是对于一个大的源代码库来说可以花费大量的时间。
我所知道的唯一工具可以做到这一点,而且非常好,不是免费的b $ b。 PC-Lint, http://www.gimpel.com 。这个功能真的很不错
小奖金。单独的代码检查功能值得多次生成专业代码的价格。
-
Jack Klein
主页: http://JK-Technology.Com
常见问题解答
comp.lang.c http: //c-faq.com/
comp.lang.c ++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c ++
http://www.club。 cc.cmu.edu/~ajo/docs/FAQ-acllc.html
I see you''ve already got a few recommendations for the comment out and
look for errors school of thought, which does work but can take an
enormous amount of time for a large source code base.
The only tool that I know of that does this, and really well, is not
free. PC-Lint, http://www.gimpel.com. This feature is really a nice
little bonus. Its code checking function alone is worth many times
its price to anyone producing professional code.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
这篇关于用于确定需要/不需要哪些标头的工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!