Mark unwind-dw2-fde-glibc.c variable possibly unused

Thomas Schwinge thomas@codesourcery.com
Thu Nov 22 16:41:00 GMT 2012


Hi!

On Wed, 21 Nov 2012 17:18:11 +0000, "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> sysdeps/generic/unwind-dw2-fde-glibc.c contains a variable that is
> only used if __i386__ is defined, so resulting in set-but-not-used
> warnings for other architectures building this code.  This patch fixes
> those warnings by using __attribute__ ((unused)) on this variable.

> --- a/sysdeps/generic/unwind-dw2-fde-glibc.c
> +++ b/sysdeps/generic/unwind-dw2-fde-glibc.c
> @@ -85,7 +85,8 @@ static int
>  _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
>  {
>    struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr;
> -  const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic;
> +  const ElfW(Phdr) *phdr, *p_eh_frame_hdr;
> +  const ElfW(Phdr) *p_dynamic __attribute__ ((unused));

I first thought, if it's only used if __i386__ is defined, then why not
conditionalize this one on __i386__, too.  Looking at the code, however,
your proposed approach is simpler, so this looks good to me.


Grüße,
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20121122/7988e117/attachment.sig>


More information about the Libc-alpha mailing list