From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81114 invoked by alias); 6 Apr 2016 08:50:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 80964 invoked by uid 89); 6 Apr 2016 08:50:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=p, DELETE, symbolsver, SYMVER_FILE X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 06 Apr 2016 08:50:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0C26201E8; Wed, 6 Apr 2016 08:50:50 +0000 (UTC) Received: from localhost (ovpn-116-70.ams2.redhat.com [10.36.116.70]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u368on9v015547; Wed, 6 Apr 2016 04:50:50 -0400 Date: Wed, 06 Apr 2016 08:50:00 -0000 From: Jonathan Wakely To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: Re: [patch] Remove superfluous /dev/null on grep line Message-ID: <20160406085048.GL5814@redhat.com> References: <3554293.nIQqjdAT3l@polaris> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <3554293.nIQqjdAT3l@polaris> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-04/txt/msg00275.txt.bz2 On 06/04/16 09:39 +0200, Eric Botcazou wrote: >Hi, > >we recently ran into build failures on Windows systems using a somewhat old >grep, coming from a syntax error in the libstdc++-symbols.ver version file: > ># Symbol versioning for shared libraries. >if ENABLE_SYMVERS >libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \ > $(port_specific_symbol_files) > cp ${glibcxx_srcdir}/$(SYMVER_FILE) $@.tmp > chmod +w $@.tmp > if test "x$(port_specific_symbol_files)" != x; then \ > if grep '^# Appended to version file.' \ > $(port_specific_symbol_files) /dev/null > /dev/null 2>&1; then >\ > cat $(port_specific_symbol_files) >> $@.tmp; \ > else \ > sed -n '1,/DO NOT DELETE/p' $@.tmp > tmp.top; \ > sed -n '/DO NOT DELETE/,$$p' $@.tmp > tmp.bottom; \ > cat tmp.top $(port_specific_symbol_files) tmp.bottom > $@.tmp; \ > rm tmp.top tmp.bottom; \ > fi; \ > fi > >Note the double /dev/null on the grep command line. The first one causes the >grep to fail when the command is invoked on these systems. That's old code, >but it is now invoked for config/abi/pre/float128.ver on the mainline and 5 >branch and this breaks the build on these systems (4.9 builds fine). > >This first /dev/null doesn't serve any useful purpose and seems to be a typo, Doesn't it mean that if $port_specific_symbol_files contains only whitespace we don't hang waiting for input from stdin? The 'if' above it will be true when "x$port_specific_symbol_files" = "x " or similar. I don't see any way for that to happen in the FSF tree, so it should be safe. I'm a bit concerned about making that change this late in stage 4 though. There isn't much time to find out if it breaks an obscure target.