From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31759 invoked by alias); 17 Feb 2014 07:41:27 -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 31750 invoked by uid 89); 17 Feb 2014 07:41:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Feb 2014 07:41:25 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1WFIpO-0002s6-2O from Thomas_Schwinge@mentor.com for gdb-patches@sourceware.org; Sun, 16 Feb 2014 23:41:22 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sun, 16 Feb 2014 23:41:21 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Mon, 17 Feb 2014 07:41:19 +0000 From: Thomas Schwinge To: Yao Qi CC: Subject: Re: [PATCH PUSHED] Fix missing-prototypes warnings in gnu-nat.c In-Reply-To: <1392608048-29308-1-git-send-email-yao@codesourcery.com> References: <1392608048-29308-1-git-send-email-yao@codesourcery.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Mon, 17 Feb 2014 07:41:00 -0000 Message-ID: <87eh32i3tz.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-02/txt/msg00527.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1976 Hi! On Mon, 17 Feb 2014 11:34:08 +0800, Yao Qi wrote: > A recent change (commit 3398af6aa352b0611bc9d66aed72080a876e42d4) > in gnu-nat.c causes the some missing-prototypes warnings, >=20 > ../../../git/gdb/gnu-nat.c:1864:1: error: no previous prototype for 'S_pr= oc_pid2task_reply' [-Werror=3Dmissing-prototypes] > ../../../git/gdb/gnu-nat.c:1866:1: error: no previous prototype for 'S_pr= oc_task2pid_reply' [-Werror=3Dmissing-prototypes] > ../../../git/gdb/gnu-nat.c:1868:1: error: no previous prototype for 'S_pr= oc_task2proc_reply' [-Werror=3Dmissing-prototypes] >=20 > A new macro ILL_RPC was added, which defines some external > functions. However, they are not declared and GCC complains about this. Ha, so I wondered why did you see this error, and I did not when testing my patch, commit 3398af6aa352b0611bc9d66aed72080a876e42d4? Next I wondered, why missing prototypes only for these three functions? This lead to the answer: depending on which RPCs are defined on the Mach or Hurd side, MIG will generate different sets of stub functions (and respective prototypes in the *_S.h header file). We recently added some new RPCs to the Hurd, and I also added the respective stubs to GDB in my recent patch -- in my build, the prototypes come from the *_S.h header file, but not in yours, as you're using a toolchain that does not define these RPCs (no worries, they're of no use for GDB). > This patch is to add the declarations of these external function in > macro ILL_RPC. Pushed it as obvious. > * gnu-nat.c (ILL_RPC): Declare defined function. > --- a/gdb/gnu-nat.c > +++ b/gdb/gnu-nat.c > @@ -1783,6 +1783,7 @@ do_mach_notify_dead_name (mach_port_t notify, mach_= port_t dead_port) >=20=20 > =0C > #define ILL_RPC(fun, ...) \ > + extern kern_return_t fun (__VA_ARGS__); \ > kern_return_t fun (__VA_ARGS__) \ > { \ > warning (_("illegal rpc: %s"), #fun); \ Yes, this looks fine, thanks! Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 489 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAEBAgAGBQJTAb0ZAAoJENuKOtuXzphJFakIAKJ+xmLMsmG9lCvKBY7+a9h+ oIRtmrbzdJeikGxyt2FbGP8/la2rrAu3MM+fL4Tz0P+rY+PXVv6SSFkWPsKu4M54 1qMrgeNPqdrZN04niAtorECA94036TpXcT2CZEX3fsPkVhgC+lnIBY+I7pscKEic A15mXxkX2rJMB9cn0VnL1+4nSTfv32YIAMouVCrk95g0BEQ+C4opkxuY5oM4d3Mk GE4586vDmM9+CX8pJHQG+UqmnObJr2XCmKRm2FBaWJXaYjTGmjhi4Jveu/X1k1kK rwkRweDyvVb/kVATxTjGPtgNJqxdIkMuxFGcRylslgukpcJPr7GMp+YFS/RttyM= =BTaS -----END PGP SIGNATURE----- --=-=-=--