I\'ve installed gcc-4.6 using the homebrew-alternatives gcc formula, but I can\'t seem to get it to use that GCC to install other formulas. Specifi
gcc-4.6
homebrew-alternatives gcc
These answers are all fairly old now. It seems that recent versions of homebrew have a '--cc' option that enables you to select the c compiler to use. For example
brew install --cc=gcc-6
will install using the brew version of gcc