From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98596 invoked by alias); 18 May 2017 11:09:09 -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 98475 invoked by uid 89); 18 May 2017 11:09:08 -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=Continuing, continuing 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:07 +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 833338553E for ; Thu, 18 May 2017 11:09:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 833338553E 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 833338553E Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED4BA17584 for ; Thu, 18 May 2017 11:09:08 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/3] gdb.base/fileio.c: Fix several -Wreturn-type warnings Date: Thu, 18 May 2017 11:09:00 -0000 Message-Id: <1495105747-21675-2-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/msg00414.txt.bz2 All the "test_" functions warn like: src/gdb/testsuite/gdb.base/fileio.c: In function ‘test_close’: src/gdb/testsuite/gdb.base/fileio.c:280:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ Nothing looks at the return of these functions, so just make them return void. While at it, "()" is not the same as "(void)" in C - fix that too. gdb/ChangeLog: 2017-05-18 Pedro Alves * gdb.base/fileio.c (stop, test_open, test_write, test_read) (test_lseek, test_close, test_stat, test_fstat, test_isatty) (test_system, test_rename, test_unlink, test_time): Change prototypes. * gdb.base/fileio.exp (stop_msg): Adjust. --- gdb/testsuite/gdb.base/fileio.c | 50 +++++++++++++++++++-------------------- gdb/testsuite/gdb.base/fileio.exp | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index 38537db..415f2d0 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -74,14 +74,14 @@ static const char *strerrno (int err); #define STRING "Hello World" -static void stop () {} +static void stop (void) {} /* 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 () +void +test_open (void) { int ret; @@ -140,8 +140,8 @@ test_open () stop (); } -int -test_write () +void +test_write (void) { int fd, ret; @@ -181,8 +181,8 @@ test_write () stop (); } -int -test_read () +void +test_read (void) { int fd, ret; char buf[16]; @@ -213,8 +213,8 @@ test_read () stop (); } -int -test_lseek () +void +test_lseek (void) { int fd; off_t ret = 0; @@ -255,8 +255,8 @@ test_lseek () stop (); } -int -test_close () +void +test_close (void) { int fd, ret; @@ -281,8 +281,8 @@ test_close () stop (); } -int -test_stat () +void +test_stat (void) { int ret; struct stat st; @@ -316,8 +316,8 @@ test_stat () stop (); } -int -test_fstat () +void +test_fstat (void) { int fd, ret; struct stat st; @@ -347,8 +347,8 @@ test_fstat () stop (); } -int -test_isatty () +void +test_isatty (void) { int fd; @@ -377,8 +377,8 @@ test_isatty () char sys[1512]; -int -test_system () +void +test_system (void) { /* * Requires test framework to switch on "set remote system-call-allowed 1" @@ -409,8 +409,8 @@ test_system () stop (); } -int -test_rename () +void +test_rename (void) { int ret; struct stat st; @@ -464,8 +464,8 @@ test_rename () char name[1256]; -int -test_unlink () +void +test_unlink (void) { int ret; @@ -504,8 +504,8 @@ test_unlink () stop (); } -int -test_time () +void +test_time (void) { time_t ret, t; diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp index 6bb7141..99afaff 100644 --- a/gdb/testsuite/gdb.base/fileio.exp +++ b/gdb/testsuite/gdb.base/fileio.exp @@ -69,7 +69,7 @@ if ![runto_main] then { gdb_test "break stop" "Breakpoint .*$srcfile.*" -set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(\\) {}.*" +set stop_msg ".*Breakpoint .* stop \\(\\) at.*$srcfile:.*static void stop \\(void\\) {}.*" gdb_test continue \ "Continuing\\..*open 1:.*OK$stop_msg" \ -- 2.5.5