mxcl/homebrew — pull request #8800 by mistydemeo (2011-11-26 01:42:41+00:00)
Title: Utils: update gcc version detection logic

The switch from `gcc -v 2&>1` to `gcc --version` revealed a problem with the old methods; the redirection was supressing the `-bash: /usr/bin/gcc-4.0: No such file or directory` messages which would otherwise be barfed out during `brew --config` and `brew doctor`. I rewrote `gcc_40_build_version` and `gcc_42_build_version` with the syntax from the llvm-gcc and clang checks, so the shell isn't called anymore if the files don't exist.

This has a nice side effect of fixing the missing gcc-4.2 detection, which was confusing Xcode 4.2 users.

I've tested with `brew --config` and `brew doctor`, and it works okay. Anything else it might break?