Important: Xcode 4.2 and later do not support GCC. You should use the Clang compiler instead.
Introduction to GCC Porting Guide
Mac OS X v10.4 introduced a new version of the GCC compiler: version 4.0. This new compiler provided significant improvements for the compilation of C, C++, Objective-C, and Objective-C++. With these improvements, though, came stricter rules and better conformance to the C and C++ standards. As a result, developers may have encountered errors when compiling code that had previously compiled without error under GCC 3.3.
This document provides advice for how to modify your code in ways that make it more compatible with the latest versions of GCC. Because of its improved support for uniform coding standards, compiling your code under GCC 4.0 or later should make it easier to develop code that compiles successfully on other platforms and with other compilers.
Organization of This Document
This document includes the following articles:
General Guidelines for Using GCC offers general porting advice for developers coming to GCC 4.0 for the first time. It also discusses issues related to universal binaries and CodeWarrior migration.
Porting from GCC 3.3 to GCC 4.0 provides specific information on how to migrate your code from GCC 3.3 to GCC 4.0.
For reference information on the GCC compiler, see the following documents:
GNU C/C++/Objective-C 4.0.1 Compiler User Guide