我试着谷歌,但没有发现任何东西.
解决方法
4.0.0.8只是4.0的补丁修订版,其发行说明如下:http://gcc.gnu.org/gcc-4.0/changes.html
4.3.2是4.3的补丁修订版,其发行说明如下:http://gcc.gnu.org/gcc-4.3/changes.html
如果你看看它们之间的差异,我认为以下列表涵盖了你真正关心的GCC 4.0和4.3之间最重要的区别.
GCC 4.3.2(包括GCC 4.1和GCC 4.2的变化):
Experimental support for the ISO C++0x standard(这是一个链接)
> long long现在已经在C中正式支持(尽管它是旧版GCC提供的扩展)
>支持模板extern
>你在std :: vector< std :: vector< int>>中看到的直角括号现在支持(请注意声明末尾两个>之间缺少空格).
> experimental support for Variadic Template Arguments
> Static assertions
>和其他一些人
更多TR1库支持
>< regex> (gcc 4.3),< random> (gcc 4.2)和< complex> (gcc 4.2)
C能见度处理已经彻底改变. (GCC 4.2)
Restricted visiblity is propagated from classes to members,from functions to local statics,and from templates and template arguments to instantiations,unless the latter has explicitly declared visibility.
The visibility attribute for a class must come between the class-key and the name,not after the closing brace.
Attributes are now allowed for enums and elaborated-type-specifiers that only declare a type.
Members of the anonymous namespace are now local to a particular translation unit,along with any other declarations which use them,though they are still treated as having external linkage for language semantics.
在GCC 4.2中删除了未记录的模板扩展(在4.1中已弃用)
The (undocumented) extension which permitted templates with default arguments to be bound to template template parameters with fewer parameters has been removed. For example:
template <template <typename> class C> void f(C<double>) {} template <typename T,typename U = int> struct S {}; template void f(S<double>);
is no longer accepted by G++. The reason this code is not accepted is that S is a template with two parameters; therefore,it cannot be bound to C which has only one parameter.
另外,请查看porting to GCC 4.3 guide,其中一些重要内容如下:
向后兼容/已弃用标头已被删除.
大多数情况下,这意味着已删除了一堆预标准标题,例如< iostream.h> (使用标准< iostream>),< hash_map.h> (使用< tr1 / unordered_map>)< hashtable.h> (根据需要使用< tr1 / unordered_map>或< tr1 / unordered_set>)等.再次,不是什么大不了的事.
更严格的标准执行
例如,main的双参数形式上的签名必须正确.
void func(int x,int x); // now an error
并且有各种错误修复,以及我认为不会真正影响您如何编写竞争代码(如删除/添加新编译器标志)以及删除诸如<?之类的内容的更改.和>?操作符(曾经使用过那些?).
总而言之,如果你不得不为两个编译器编写代码,我不认为这两者之间的差异会让你感到非常悲伤.