From patchwork Thu May 18 11:09:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 20485 Received: (qmail 98463 invoked by alias); 18 May 2017 11:09:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 98447 invoked by uid 89); 18 May 2017 11:09:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1556 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 ESMTP; Thu, 18 May 2017 11:09:06 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AA7980E7C for ; Thu, 18 May 2017 11:09:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9AA7980E7C Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9AA7980E7C Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26E3A17584 for ; Thu, 18 May 2017 11:09:07 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 1/3] gdb.base/fileio.exp: Remove nowarnings Date: Thu, 18 May 2017 12:09:05 +0100 Message-Id: <1495105747-21675-1-git-send-email-palves@redhat.com> In-Reply-To: <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com> References: <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com> ... and quiet -Wnonnull in a different way. gdb/testsuite/ChangeLog: 2017-05-18 Pedro Alves * gdb.base/fileio.c (null_str): New global. (test_stat): Use it. * gdb.base/fileio.exp: Remove nowarnings. --- gdb/testsuite/gdb.base/fileio.c | 6 +++++- gdb/testsuite/gdb.base/fileio.exp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index e443173..38537db 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -76,6 +76,10 @@ static const char *strerrno (int err); static void stop () {} +/* A NULL string. We pass this to stat below instead of a NULL + literal to avoid -Wnonnull warnings. */ +const char *null_str; + int test_open () { @@ -294,7 +298,7 @@ test_stat () stop (); /* NULL pathname */ errno = 0; - ret = stat (NULL, &st); + ret = stat (null_str, &st); printf ("stat 2: ret = %d, errno = %d %s\n", ret, errno, strerrno (errno)); stop (); diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp index 14aaa0d..6bb7141 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -31,7 +31,7 @@ if {[is_remote host]} { if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ executable \ - [list debug nowarnings "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } { + [list debug "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } { untested "failed to compile" return -1 }