This is just a rant (and the code is not the real code).
Recently I ran into a runtime problem because of the following scenario (resulted from a typo).
Why o why can't MingW not Visual Express 2005 even warn that a member is being initialized with itself (or do I miss some compiler flags, or are there any cases where this obviously isn't an error)!?Code:class A { int x; public: A(): x(x) { } }; int main() {}
Another recent annoyance is with Visual Express 2005. I couldn't figure the compiler error out until I compiled the same file with MingW, because the error message is so misleading that I was looking intently at the wrong place (and all the files included from this header to see if there's a stupid error like a missing ; or a mistyped inclusion guard etc):
MSVC error diagnostics:Code:class A { int n; public: A(float, n m) {n = m; } }; int main() {}
WTF! How is float (in my case another type - so I suspected circular dependencies) unexpected?main.cpp(5) : error C2062: type 'float' unexpected
whereas MingW says
main.cpp:5: error: `n' is not a type