I\'m sure there must be a way to do this. As you are probably aware the latest versions of Xcode (and in fact I think all versions of Xcode) on Leopard come with GCC 4.0.1 a
In the Project or Target Info Window set the build setting "C/C++ compiler version" (GCC_VERSION).
Or in the Target Info Window you can change the "System C rule" to your favorite GCC version.
Update: Regarding the command line I would leave to Leopard the decision of what should be the default compiler. If you want to use a different compiler with tools like Autotools configure you had better to define the CC variable.
CC=gcc-4.2 ./configure
or
export CC=gcc-4.2