We have added new command-line options -finstrument-functions-exclude-function-list and -finstrument-functions-exclude-file-list. They provide more control over which functions are annotated by the -finstrument-functions option.
Implicit conversions between generic vector types are now only permitted when the two vectors in question have the same number of elements and compatible element types. (Note that the restriction involves compatible element types, not implicitly-convertible element types: thus, a vector type with element type int may not be implicitly converted to a vector type with element type unsigned int.) This restriction, which is in line with specifications for SIMD architectures such as AltiVec, may be relaxed using the flag -flax-vector-conversions. This flag is intended only as a compatibility measure and should not be used for new code.
-Warray-bounds has been added and is now enabled by default for -Wall . It produces warnings for array subscripts that can be determined at compile time to be always out of bounds. -Wno-array-bounds will disable the warning.
The constructor and destructor function attributes now accept optional priority arguments which control the order in which the constructor and destructor functions are run.
(难道是ObjectiveC中的特性?)
New command-line options -Wtype-limits, -Wold-style-declaration, -Wmissing-parameter-type, -Wempty-body, -Wclobbered and -Wignored-qualifiers have been added for finer control of the diverse warnings enabled by -Wextra.
A new function attribute alloc_size has been added to mark up malloc style functions. For constant sized allocations this can be used to find out the size of the returned pointer using the __builtin_object_size() function for buffer overflow checking and similar. This supplements the already built-in malloc and calloc constant size handling.
Integer constants written in binary are now supported as a GCC extension. They consist of a prefix 0b or 0B, followed by a sequence of 0 and 1 digits.
GCC扩展支持用二进制格式书写整型常量。格式是0b/0B前缀后加0/1序列。
A new predefined macro __COUNTER__ has been added. It expands to sequential integral values starting from 0. In conjunction with the ## operator, this provides a convenient means to generate unique identifiers.
A new command-line option -fdirectives-only has been added. It enables a special preprocessing mode which improves the performance of applications like distcc and ccache.
Fixed-point data types and operators have been added. They are based on Chapter 4 of the Embedded-C specification (n1169.pdf). Currently, only MIPS targets are supported.
(仅MIPS目标机支持,忽略之。)
C++
Experimental support for the upcoming ISO C++ standard, C++0x.
实验性支持C++0x
(原来说C++07差不多,现在看来又跳票了,看看跟暴雪谁跳的厉害)
-Wc++0x-compat has been added and is now enabled by default for -Wall. It produces warnings for constructs whose meaning differs between ISO C++ 1998 and C++0x.
The -Wparentheses option now works for C++ as it does for C. It warns if parentheses are omitted when operators with confusing precedence are nested. It also warns about ambiguous else statements. Since -Wparentheses is enabled by -Wall, this may cause additional warnings with existing C++ code which uses -Wall. These new warnings may be disabled by using -Wall -Wno-parentheses.
The -Wmissing-declarations now works for C++ as it does for C.
选项-Wmissing-declarations现在在C++中作用与C中一致。
The -fvisibility-ms-compat flag was added, to make it easier to port larger projects using shared libraries from Microsoft's Visual Studio to ELF and Mach-O systems.
C++ attribute handling has been overhauled for template arguments (ie dependent types). In particular, __attribute__((aligned(T))); works for C++ types.
An experimental parallel mode has been added. This is a parallel implementation of many C++ Standard library algorithms, like std::accumulate, std::for_each, std::transform, or std::sort, to give but four examples. These algorithms can be substituted for the normal (sequential) libstdc++ algorithms on a piecemeal basis, or all existing algorithms can be transformed via the -D_GLIBCXX_PARALLEL macro.
Debug mode versions of classes in <unordered_set> and <unordered_map>.
<unordered_set>和<unordered_map>中的类增加Debug版。
Formal deprecation of <ext/hash_set> and <ext/hash_map>, which are now <backward/hash_set> and <backward/hash_map>. This code: #include <ext/hash_set>
__gnu_cxx::hash_set<int> s;
Can be transformed (in order of preference) to: #include <tr1/unordered_set>
std::tr1::unordered_set<int> s;
or #include <backward/hash_set>
__gnu_cxx::hash_set<int> s;
Similar transformations apply to __gnu_cxx::hash_map, __gnu_cxx::hash_multimap, __gnu_cxx::hash_set, __gnu_cxx::hash_multiset.