3

The question is pretty straight forward. I'm currently using Source Insight, but its parsing of preprocessor macros is not perfect. I need a reliable tool to show me the treeview of nested #ifdef and #if macros.

I'm writing a new function, and I need to know in which "scope" to put it, to avoid cluttering the global namespace when the #defines this function depends on aren't defined.

4

1 回答 1

2

任何支持代码折叠的编辑器或 IDE 都应该允许您折叠和展开代码块。我个人喜欢使用Eclipse,因为它会更进一步并自动确定哪些#ifdef块是非活动的。非活动代码显示为灰色并自动折叠。Eclipse 还会标记某些类型的错误,例如未定义的标识符。这也应该对您的情况有所帮助,因为如果您在错误的“范围”中编写了一个函数并且它使用了一个由于 原因而当前不可用的函数,#ifdefIDE 会将函数调用标记为“对未定义函数的调用”。

于 2012-08-20T20:15:11.473 回答