I want to know which gcc/g++ version released is the most stable to date? I had an impression that gcc version 2.95 was the most stable but a few peers told me that gcc 3.x version开发者_StackOverflow中文版s are now the most stable.
The 2.95 branch hasn't had an update in over ten years. I certainly wouldn't be using it for anything voluntarily. Use whatever is the latest available for your system unless you have specific knowledge of a need to use something else (a vague "impression" is not specific knowledge, actual bugs and specific compatibility problems are).
Even 3.x is rapidly aging. There is no general reason not to use 4.x.
The only gcc versions that are actively worked on - i.e. debugged and stabilized are gcc-4.n where n > 3 these days. Use the gcc-4.* series. Even cygwin and mingw are off gcc-3.* these days.
GCC 4.6.2 has been released recently, on 27 Oct 2011.
And chosing a specific version of GCC is not a guarantee that your binary will work on all linux-es you want, because distributions may have different versions of the C++ standard libraries.
I'll recommend not using something older than GCC 4.5, and preferably 4.6. However, you might want to use the version used to compile your linux distribution.
精彩评论