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.
Important: This document offers only guidance and tips on how to move your code to the newest revisions of the GCC compiler and is not the definitive reference for the compiler itself. If you need more information about GCC than is provided in this document, see GNU C/C++/Objective-C 4.0.1 Compiler User Guide. For a summary of compiler options, you can also consult the gcc
man page.
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.
Last updated: 2006-10-03