diff mbox series

[committed] hppa: Fix warning in pa32_fallback_frame_state

Message ID c3c47cff-b385-9fa0-3c15-0aac5291626c@bell.net
State New
Headers show
Series [committed] hppa: Fix warning in pa32_fallback_frame_state | expand

Commit Message

John David Anglin May 26, 2019, 3:24 p.m. UTC
The attached patch fixes a warning in pa32_fallback_frame_state.

Tested on hppa-unknown-linux-gnu.  Committed to gcc-9 branch and trunk.

Dave

Comments

Andreas Schwab May 26, 2019, 4:13 p.m. UTC | #1
On Mai 26 2019, John David Anglin <dave.anglin@bell.net> wrote:

> Index: config/pa/linux-unwind.h
> ===================================================================
> --- config/pa/linux-unwind.h	(revision 271614)
> +++ config/pa/linux-unwind.h	(working copy)
> @@ -130,7 +130,7 @@
>      return _URC_END_OF_STACK;
>
>    frame = (struct rt_sigframe *)(sp + off);
> -  sc = &frame->uc.uc_mcontext;
> +  sc = (struct sigcontext *)&frame->uc.uc_mcontext;

Why is it not better to use the correct type?

Andreas.
John David Anglin May 26, 2019, 9:51 p.m. UTC | #2
On 2019-05-26 12:13 p.m., Andreas Schwab wrote:
> On Mai 26 2019, John David Anglin <dave.anglin@bell.net> wrote:
>
>> Index: config/pa/linux-unwind.h
>> ===================================================================
>> --- config/pa/linux-unwind.h	(revision 271614)
>> +++ config/pa/linux-unwind.h	(working copy)
>> @@ -130,7 +130,7 @@
>>      return _URC_END_OF_STACK;
>>
>>    frame = (struct rt_sigframe *)(sp + off);
>> -  sc = &frame->uc.uc_mcontext;
>> +  sc = (struct sigcontext *)&frame->uc.uc_mcontext;
> Why is it not better to use the correct type?
I can't remember the full details why "struct sigcontext *" was used for the type of sc
but I think it was done to avoid the renaming of the fields in the mcontext_t type.

Dave
diff mbox series

Patch

Index: config/pa/linux-unwind.h
===================================================================
--- config/pa/linux-unwind.h	(revision 271614)
+++ config/pa/linux-unwind.h	(working copy)
@@ -130,7 +130,7 @@ 
     return _URC_END_OF_STACK;

   frame = (struct rt_sigframe *)(sp + off);
-  sc = &frame->uc.uc_mcontext;
+  sc = (struct sigcontext *)&frame->uc.uc_mcontext;

   new_cfa = sc->sc_gr[30];
   fs->regs.cfa_how = CFA_REG_OFFSET;