From patchwork Tue Dec 20 16:55:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 132454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 431F3B704B for ; Wed, 21 Dec 2011 03:55:42 +1100 (EST) Received: (qmail 24628 invoked by alias); 20 Dec 2011 16:55:39 -0000 Received: (qmail 24620 invoked by uid 22791); 20 Dec 2011 16:55:38 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Dec 2011 16:55:24 +0000 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 1F57B1C01D91 for ; Tue, 20 Dec 2011 17:55:22 +0100 (CET) X-Auth-Info: FD1LJnh7BcyHeTrQa+UN3FdpfvfHNbHiYiyLVzJxceA= Received: from igel.home (ppp-93-104-156-252.dynamic.mnet-online.de [93.104.156.252]) by mail.mnet-online.de (Postfix) with ESMTPA id D16301C00186 for ; Tue, 20 Dec 2011 17:55:22 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id A29E1CA29C; Tue, 20 Dec 2011 17:55:21 +0100 (CET) From: Andreas Schwab To: gcc-patches@gcc.gnu.org Subject: Avoid leading dash in expr call References: X-Yow: PUMP UP th' VOLUME! My BAGEL TOASTER is in tune with th' UNIVERSAL LIFE FORCE!! Date: Tue, 20 Dec 2011 17:55:20 +0100 In-Reply-To: (Andreas Schwab's message of "Sun, 18 Dec 2011 13:24:54 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Andreas Tobler pointed out that passing a string with leading dash as argument to expr is non-portable. Checked in as obvious. Andreas. 2011-12-20 Andreas Schwab * warnings.m4 (ACX_PROG_CC_WARNING_OPTS): Avoid leading dash in expr call. diff --git a/config/warnings.m4 b/config/warnings.m4 index 292e5a4..b64b594 100644 --- a/config/warnings.m4 +++ b/config/warnings.m4 @@ -32,7 +32,7 @@ for real_option in $1; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose case $real_option in - -Wno-*) option=-W`expr $real_option : '-Wno-\(.*\)'` ;; + -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; *) option=$real_option ;; esac AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option])