The version_info_macos.sh script which extracts version information from the compiler on Mac OS X is using the wrong switch, introducing the possibility of retrieving a result the script can't use.
The script reads version information by using `gcc -v`, but this is actually the switch for verbose output; it only incidentally produces a version string. Because it produces verbose output, under some circumstances it will introduce extraneous information and may produce a string with an extra quotation mark, breaking parsing. See https://github.com/mxcl/homebrew/pull/22837 for an example of where this occurs.
The attached patch fixes this by using the first line of `gcc --version` instead. Presumably similar issues will occur on other platforms, but I haven't tested or altered their scripts.
This was tested on Mac OS X 10.7.5 using GCC and clang as provided by Xcode 4.6.3.