Mac OS X ships two compilers and their corresponding toolchains. The default compiler is based on gcc 4. In addition, a compiler based on gcc 3.3 is provided. Compiling for 64-bit PowerPC and Intel-based Macintosh computers is only supported in version 4.0 and later.
Always try to compile your software using gcc 4 because future toolchains will be based on gcc version 4 or later. However, because gcc 4 is a relatively new toolchain, you may find bugs that prevent compiling certain programs.
Use of the legacy gcc 2.95.2-based toolchain is strongly discouraged unless you have to maintain compatibility with Mac OS X version 10.1.
If you run into a problem that looks like a compiler bug, the command sudo gcc_select 3.5 changes the default compiler to gcc 3.5. You can change it back at any time by typing sudo gcc_select 4.0. Do this only as a last resort, though. If possible, you should make whatever code and compiler flag changes are needed to get gcc 4.0 to compile your application.
Last updated: 2008-04-08