RE: [PATCH] cflags.SH: rework the gcc warnings selection
Paul Green [Sun, 18 Jun 2006 19:41:50 +0000 (15:41 -0400)]
From: "Green, Paul" <Paul.Green@stratus.com>
Message-ID: <F5F42E77A43DD944B6D664B00A5401CB02026106@EXNA.corp.stratus.com>

p4raw-id: //depot/perl@28402

cflags.SH

index ab79c98..7cb593b 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -181,12 +181,14 @@ Intel*) ;;
     do
        case " $ccflags " in
        *"-W$opt "*) ;;
-       *) case "`echo | $cc -W$opt -E - 2>&1`" in
+       *) case "`echo >_cflags.c | $cc -W$opt -c _cflags.c -o _cflags.o 2>&1`" in
           *"unrecognized"*) ;;
+          *"Invalid"*) ;;
           *) warn="$warn -W$opt" ;;
           esac
           ;;
        esac
+       rm -f _cflags.c cflags.o
     done
     ;;
 esac