This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: Killing some warnings
- To: Paul Hilfinger <hilfingr at gnat dot com>, gdb-patches at sources dot redhat dot com
- Subject: Re: RFC: Killing some warnings
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Mon, 12 Feb 2001 15:55:34 -0700
- References: <20010211075957.3E9F434D80@nile.gnat.com>
On Feb 11, 2:59am, Paul Hilfinger wrote:
> * hpux-thread.c (save_inferior_pid): Change call to make_cleanup
> to make arguments conform.
> (restore_inferior_pid): Change signature to that expected by
> make_cleanup.
[...]
> *************** static struct target_ops hpux_thread_ops
> *** 102,114 ****
> static struct cleanup *
> save_inferior_pid (void)
> {
> ! return make_cleanup (restore_inferior_pid, inferior_pid);
> }
>
> static void
> ! restore_inferior_pid (int pid)
> {
> ! inferior_pid = pid;
> }
>
> static int find_active_thread (void);
> --- 102,114 ----
> static struct cleanup *
> save_inferior_pid (void)
> {
> ! return make_cleanup (restore_inferior_pid, (void*) inferior_pid);
> }
>
> static void
> ! restore_inferior_pid (void* pid)
> {
> ! inferior_pid = (int) pid;
> }
>
> static int find_active_thread (void);
Personally, I'd prefer to see these changed to avoid the casts to (void *)
and (int). See the implementation in lin-thread.c (and also elsewhere)
for an example.
(If we ever get around to merging my pid/tid/lwp megapatch, these are
cleaned up everywhere. I.e, there is one implementation that all files
which need to do this sort of thing use.)
Kevin