From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98637 invoked by alias); 18 May 2017 11:09:10 -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 98479 invoked by uid 89); 18 May 2017 11:09:09 -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=HContent-Transfer-Encoding:8bit 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:08 +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 5584481245 for ; Thu, 18 May 2017 11:09:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5584481245 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 5584481245 Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA5AA17584 for ; Thu, 18 May 2017 11:09:09 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 3/3] gdb.base/fileio.c: Fix several -Wmaybe-uninitialized warnings Date: Thu, 18 May 2017 11:09:00 -0000 Message-Id: <1495105747-21675-3-git-send-email-palves@redhat.com> In-Reply-To: <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com> References: <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2017-05/txt/msg00415.txt.bz2 src/gdb/testsuite/gdb.base/fileio.c: In function ‘test_write’: src/gdb/testsuite/gdb.base/fileio.c:158:5: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] printf ("write 1: ret = %d, errno = %d\n", ret, errno); ^ gdb/ChangeLog: 2017-05-18 Pedro Alves * gdb.base/fileio.c (test_write, test_read, test_close) (test_fstat): Don't print 'ret' in the fail path. --- gdb/testsuite/gdb.base/fileio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index 415f2d0..7f482a3 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -157,7 +157,7 @@ test_write (void) close (fd); } else - printf ("write 1: ret = %d, errno = %d\n", ret, errno); + printf ("write 1: errno = %d\n", errno); stop (); /* Write using invalid file descriptor */ errno = 0; @@ -177,7 +177,7 @@ test_write (void) close (fd); } else - printf ("write 3: ret = %d, errno = %d\n", ret, errno); + printf ("write 3: errno = %d\n", errno); stop (); } @@ -203,7 +203,7 @@ test_read (void) close (fd); } else - printf ("read 1: ret = %d, errno = %d\n", ret, errno); + printf ("read 1: errno = %d\n", errno); stop (); /* Read using invalid file descriptor */ errno = 0; @@ -271,7 +271,7 @@ test_close (void) ret == 0 ? "OK" : ""); } else - printf ("close 1: ret = %d, errno = %d\n", ret, errno); + printf ("close 1: errno = %d\n", errno); stop (); /* Close an invalid file descriptor */ errno = 0; @@ -337,7 +337,7 @@ test_fstat (void) close (fd); } else - printf ("fstat 1: ret = %d, errno = %d\n", ret, errno); + printf ("fstat 1: errno = %d\n", errno); stop (); /* Fstat using invalid file descriptor */ errno = 0; -- 2.5.5