Re: RFC: Killing some warnings

Kevin Buettner
2001-02-12T14:55:00Z

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;
> }
> \f
> 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;
> }
> \f
> 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