From: Thomas Schwinge <thomas@codesourcery.com>
To: Yao Qi <yao@codesourcery.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH PUSHED] Fix missing-prototypes warnings in gnu-nat.c
Date: Mon, 17 Feb 2014 07:41:00 -0000 [thread overview]
Message-ID: <87eh32i3tz.fsf@schwinge.name> (raw)
In-Reply-To: <1392608048-29308-1-git-send-email-yao@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]
Hi!
On Mon, 17 Feb 2014 11:34:08 +0800, Yao Qi <yao@codesourcery.com> wrote:
> A recent change (commit 3398af6aa352b0611bc9d66aed72080a876e42d4)
> in gnu-nat.c causes the some missing-prototypes warnings,
>
> ../../../git/gdb/gnu-nat.c:1864:1: error: no previous prototype for 'S_proc_pid2task_reply' [-Werror=missing-prototypes]
> ../../../git/gdb/gnu-nat.c:1866:1: error: no previous prototype for 'S_proc_task2pid_reply' [-Werror=missing-prototypes]
> ../../../git/gdb/gnu-nat.c:1868:1: error: no previous prototype for 'S_proc_task2proc_reply' [-Werror=missing-prototypes]
>
> 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)
>
> \f
> #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üße,
Thomas
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
prev parent reply other threads:[~2014-02-17 7:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 3:36 Yao Qi
2014-02-17 7:41 ` Thomas Schwinge [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87eh32i3tz.fsf@schwinge.name \
--to=thomas@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox