From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66025 invoked by alias); 16 Mar 2015 11:43:46 -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 66015 invoked by uid 89); 16 Mar 2015 11:43:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Mon, 16 Mar 2015 11:43:44 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 7DED6C12DF; Mon, 16 Mar 2015 11:43:43 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2GBhgox021778; Mon, 16 Mar 2015 07:43:42 -0400 Message-ID: <5506C1ED.8010509@redhat.com> Date: Mon, 16 Mar 2015 11:43:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: asmwarrior , GDB Patches Subject: [pushed] stub-termcap.c: prototype tputs's parameter's parameter, for C++ mode (Re: [all pushed] Re: [PATCH 00/36] Support building GDB as a C++ program) References: <1423524046-20605-1-git-send-email-palves@redhat.com> <54F0B52F.1050909@redhat.com> <54FB20E2.2040403@redhat.com> <54FB3C58.6050702@redhat.com> <550660C5.2060009@gmail.com> <5506661C.1040103@gmail.com> <55066A29.8090200@gmail.com> <55068495.5040205@gmail.com> <550693AB.60007@gmail.com> In-Reply-To: <550693AB.60007@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00445.txt.bz2 On 03/16/2015 08:26 AM, asmwarrior wrote: > int > -tputs (char *string, int nlines, int (*outfun) ()) > +tputs (char *string, int nlines, int (*outfun) (char *)) > { > while (*string) > outfun (*string++); Hmm, bitten by -fpedantic :-) : /home/pedro/gdb/mygit/src/gdb/stub-termcap.c: In function 'int tputs(char*, int, int (*)(char*))': /home/pedro/gdb/mygit/src/gdb/stub-termcap.c:75:22: warning: invalid conversion from 'char' to 'char*' [-fpermissive] outfun (*string++); ^ >From "man tputs", the correct prototype is: int tputs(const char *str, int affcnt, int (*putc)(int)); I've pushed the patch below. Thanks! --- >From b1a921c8c6f9e3d033629f32473c6470c360b43f Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 16 Mar 2015 11:28:23 +0000 Subject: [PATCH 2/3] stub-termcap.c: prototype tputs's parameter's parameter, for C++ mode src/gdb/stub-termcap.c: In function 'int tputs(char*, int, int (*)())': src/gdb/stub-termcap.c:67:22: error: too many arguments to function outfun (*string++); ^ gdb/ChangeLog: 2015-03-16 Pedro Alves Yuanhui Zhang * stub-termcap.c (tputs): Change prototype. --- gdb/ChangeLog | 5 +++++ gdb/stub-termcap.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8828635..54cb0b2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-03-16 Pedro Alves + Yuanhui Zhang + + * stub-termcap.c (tputs): Change prototype. + 2015-03-16 Yuanhui Zhang Pedro Alves diff --git a/gdb/stub-termcap.c b/gdb/stub-termcap.c index cc8632c..cecb3fb 100644 --- a/gdb/stub-termcap.c +++ b/gdb/stub-termcap.c @@ -29,7 +29,7 @@ extern int tgetent (char *buffer, char *termtype); extern int tgetnum (char *name); extern int tgetflag (char *name); extern char* tgetstr (char *name, char **area); -extern int tputs (char *string, int nlines, int (*outfun) ()); +extern int tputs (char *string, int nlines, int (*outfun) (int)); extern char *tgoto (const char *cap, int col, int row); /* Each of the files below is a minimal implementation of the standard @@ -61,7 +61,7 @@ tgetstr (char *name, char **area) } int -tputs (char *string, int nlines, int (*outfun) ()) +tputs (char *string, int nlines, int (*outfun) (int)) { while (*string) outfun (*string++); -- 1.9.3