From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16572 invoked by alias); 17 May 2017 14:17:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16551 invoked by uid 89); 17 May 2017 14:17:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Wed, 17 May 2017 14:17:32 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C03B80478; Wed, 17 May 2017 14:17:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4C03B80478 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4C03B80478 Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5A0918179; Wed, 17 May 2017 14:17:33 +0000 (UTC) Subject: Re: [PATCH OBV] Add nowarnings in gdb.base/fileio.exp To: Yao Qi , gdb-patches@sourceware.org References: <1495028758-13982-1-git-send-email-yao.qi@linaro.org> From: Pedro Alves Message-ID: <684aa647-c1f4-e0cb-c4d5-04bd55463e20@redhat.com> Date: Wed, 17 May 2017 14:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1495028758-13982-1-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-05/txt/msg00393.txt.bz2 FWIW, I think that wrapping the offending code with #pragma diagnostics push #pragma diagnostics ignored "-Wnonnull" ... stat (NULL, ...); #pragma diagnostics pop would be appropriate in this case. This testcase is checking that the syscalls on the target map back to host I/O on the gdb side, and some targets have slightly non-POSIX-like system calls APIs; IMHO, it's better to see warnings due to such mismatches instead of potentially silently miscompiling. Thanks, Pedro Alves On 05/17/2017 02:45 PM, Yao Qi wrote: > I see the following warning in gdb.base/fileio.c, > > testsuite/gdb.base/fileio.c:297:3: warning: null argument where non-null required (argument 1) [-Wnonnull] > ret = stat (NULL, &st); > ^ > > This patch adds "nowarnings" to the list passed to gdb_compile. > > It is obvious, patch is pushed in. > > gdb/testsuite: > > 2017-05-17 Yao Qi > > * gdb.base/fileio.exp: Pass nowarnings to gdb_compile. > --- > gdb/testsuite/ChangeLog | 4 ++++ > gdb/testsuite/gdb.base/fileio.exp | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog > index 91712e2..6f877da 100644 > --- a/gdb/testsuite/ChangeLog > +++ b/gdb/testsuite/ChangeLog > @@ -1,3 +1,7 @@ > +2017-05-17 Yao Qi > + > + * gdb.base/fileio.exp: Pass nowarnings to gdb_compile. > + > 2017-05-17 Simon Marchi > > * gdb.base/set-inferior-tty.exp (test_set_inferior_tty): Add > diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp > index 6bb7141..14aaa0d 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 "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } { > + [list debug nowarnings "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } { > untested "failed to compile" > return -1 > } >