这里有一个代码来演示一个恼人的问题:
class A {
public:
A():
m_b(1),
m_a(2)
{}
private:
int m_a;
int m_b;
};
这是控制台视图的输出:
make all
Building file: ../test.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.d" -o"test.o" "../test.cpp"
../test.cpp: In constructor 'A::A()':
../test.cpp:9: warning: 'A::m_b' will be initialized after
../test.cpp:8: warning: 'int A::m_a'
../test.cpp:3: warning: when initialized here
Finished building: ../test.cpp
问题在于,在“问题”视图中,我将看到 3 个单独的警告(输出中包含警告词的行),而输出中确实有 4 行描述了一个问题。
有什么我想念的吗?
附加问题。也许它是 Eclipse 精神,但有没有办法让控制台视图像大多数 IDE 一样可点击(例如 Visual Studio、emacs ...)
谢谢迪玛