From patchwork Tue Oct 11 04:49:48 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Gerald Pfeifer
+The GCC 4.6 release series differs from previous GCC releases in more
+than the usual list of
+changes. Some of
+these are a result of bug fixing, and some old behaviors have been
+intentionally changed in order to support new standards, or relaxed
+instandards-conforming ways to facilitate compilation or runtime
+performance. Some of these changes are not visible to the naked eye
+and will not cause problems when updating from older versions.
+
+However, some of these changes are visible, and can cause grief to
+users porting to GCC 4.6. This document is an effort to identify major
+issues and provide clear solutions in a quick and easily searched
+manner. Additions and suggestions for improvement are welcome.
+
+The behavior of
+For example,
+Porting to GCC 4.6
+
+C language issues
+
+New warnings for unused variables and parameters
+
+-Wall
has changed and now includes the
+new warning flags -Wunused-but-set-variable
and
+(with -Wall
+-Wextra
) -Wunused-but-set-parameter
. This may
+result in new warnings in code that compiled cleanly with previous
+versions of GCC.
+
+ void fn (void)
+ {
+ int foo;
+ foo = bar (); /* foo is never used. */
+ }
+
+Gives the following diagnostic:
+
+warning: variable "foo" set but not used [-Wunused-but-set-variable]
+
+
-Werror
and optimization flags above -O2
+may result in compile errors when using glibc optimizations
+for strcmp
.
+
+
++For example, +
+#include+Results in the following diagnostic: ++void do_rm_rf (const char *p) { if (strcmp (p, "/") == 0) return; } +
+error: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C1 +- C2 [-Werror=strict-overflow] ++ + +
+To work around this, use -D__NO_STRING_INLINES
.
+
+Many of the standard C++ library include files have been edited to no
+longer include <cstddef> to get namespace std
+-scoped versions of size_t
and ptrdiff_t
.
+
+As such, C++ programs that used the macros NULL
+or offsetof
without including <cstddef> will no
+longer compile. The diagnostic produced is similar to:
+
+error: 'ptrdiff_t' does not name a type ++ +
+error: 'size_t' has not been declared ++ +
+error: 'NULL' was not declared in this scope ++ +
+error: there are no arguments to 'offsetof' that depend on a template +parameter, so a declaration of 'offsetof' must be available ++ +
+Fixing this issue is easy: just include <cstddef>. +
+ + + ++Jakub Jelinek, + GCC +4.6 related common package rebuild failures (was Re: mass rebuild status) +
+ ++Matthias Klose, +prepare +to fix build failures with new GCC versions +
+ ++Jim Meyering, + gcc-4.6.0-0.12.fc15.x86_64 breaks strcmp? +
+ + + + + + +