[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
Related show

Commit Message

John David Anglin May 26, 2019, 3:24 p.m.
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
-- 
John David Anglin  dave.anglin@bell.net

2019-05-26  John David Anglin  <danglin@gcc.gnu.org>

	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Add cast.

Comments

Andreas Schwab May 26, 2019, 4:13 p.m. | #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.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
John David Anglin May 26, 2019, 9:51 p.m. | #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

-- 
John David Anglin  dave.anglin@bell.net

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;