Silence warnings when testing gccs

This silences the warning that gcc-4.2 produces on Yosemite:

    couldn't understand kern.osversion `14.0.0'
This commit is contained in:
Mislav Marohnić 2014-10-27 12:59:26 +01:00
parent 10fd04909d
commit dafba300b1
2 changed files with 11 additions and 1 deletions

View file

@ -766,7 +766,7 @@ verify_gcc() {
return 1
fi
local version="$("$gcc" --version || true)"
local version="$("$gcc" --version 2>/dev/null || true)"
if [ -z "$version" ]; then
return 1
fi

View file

@ -36,3 +36,13 @@ CC=${TMP}/bin/gcc
MACOSX_DEPLOYMENT_TARGET=10.9
OUT
}
@test "require_gcc silences warnings" {
stub gcc '--version : echo warning >&2; echo 4.2.1'
run_inline_definition <<DEF
require_gcc
echo \$CC
DEF
assert_success "${TMP}/bin/gcc"
}