Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andreas Schwab <schwab@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix invalid implicit conversions from void *
Date: Thu, 19 May 2016 13:07:00 -0000	[thread overview]
Message-ID: <27288423-ea78-4bd7-6eb2-68911a275690@redhat.com> (raw)
In-Reply-To: <mvminya5hu9.fsf@hawking.suse.de>

On 05/19/2016 01:54 PM, Andreas Schwab wrote:
> Tested on ia64-suse-linux.

Thanks.

> 
> 	* ia64-libunwind-tdep.c (libunwind_descr): Add cast from void *.
> 	(libunwind_frame_set_descr): Likewise.
> 	(libunwind_frame_cache): Likewise.
> 	(libunwind_frame_dealloc_cache): Likewise.
> 	(libunwind_frame_sniffer): Likewise.
> 	(libunwind_search_unwind_table): Likewise.
> 	(libunwind_sigtramp_frame_sniffer): Likewise.
> 	(libunwind_get_reg_special): Likewise.
> 	(libunwind_load): Likewise.
> 	* ia64-linux-nat.c (ia64_linux_fetch_register): Likewise.
> 	(ia64_linux_store_register): Likewise.
> 	(ia64_linux_xfer_partial): Likewise.
> 	* ia64-tdep.c (ia64_access_reg): Likewise.
> 	(ia64_access_fpreg): Likewise.
> 	(ia64_access_rse_reg): Likewise.
> 	(ia64_access_rse_fpreg): Likewise.

This is OK.  Though ...

>    /* Initialize pointers to the dynamic library functions we will use.  */
>  
> -  unw_get_reg_p = dlsym (handle, get_reg_name);
> +  unw_get_reg_p = ((int (*) (unw_cursor_t *, unw_regnum_t, unw_word_t *))
> +		   dlsym (handle, get_reg_name));

... I think would be nicer to use typedefs for these.  Something like,
at the top:

 -static int (*unw_get_reg_p) (unw_cursor_t *, unw_regnum_t, unw_word_t *);
 +typedef int (unw_get_reg_p_ftype) (unw_cursor_t *, unw_regnum_t, unw_word_t *);
 +static unw_get_reg_p_ftype *unw_get_reg_p;

 etc.

and then:

 unw_get_reg_p = (unw_get_reg_p_ftype *) dlsym (handle, get_reg_name);

It's what we've done in other similar cases, like linux-thread-db.c,
for example.

Thanks,
Pedro Alves


  reply	other threads:[~2016-05-19 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 12:54 Andreas Schwab
2016-05-19 13:07 ` Pedro Alves [this message]
2016-05-19 13:32   ` Andreas Schwab

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=27288423-ea78-4bd7-6eb2-68911a275690@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@suse.de \
    /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