From d9136efd7ac5f7655376057e0ba28498a975216b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 18 Apr 2021 13:22:26 +0200 Subject: [PATCH] gcc-version.sh: Cygwin fix On Cygwin, "echo __GNUC__ __GNUC_MINOR__ | gcc -E -xc -" can print extra empty trailing line. Signed-off-by: Denys Vlasenko --- scripts/gcc-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gcc-version.sh b/scripts/gcc-version.sh index 34510804f..9376ed4fb 100755 --- a/scripts/gcc-version.sh +++ b/scripts/gcc-version.sh @@ -8,5 +8,5 @@ compiler="$*" -MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1) +MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | grep . | tail -n 1) printf '%02d%02d\n' $MAJ_MIN