diff mbox

[COMMITTED] Silence a missing-noreturn warning for _Unwind_Resume.

Message ID 20140509170647.9E9772C39EF@topped-with-meat.com
State New
Headers show

Commit Message

Roland McGrath May 9, 2014, 5:06 p.m. UTC
2014-05-09  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/gnu/unwind-resume.c (libgcc_s_resume): Mark as noreturn.

Comments

Andreas Schwab May 9, 2014, 5:50 p.m. UTC | #1
Roland McGrath <roland@hack.frob.com> writes:

> @@ -48,7 +50,7 @@ _Unwind_Resume (struct _Unwind_Exception *exc)
>  {
>    if (__glibc_unlikely (libgcc_s_resume == NULL))
>      init ();
> -  libgcc_s_resume (exc);
> +  (*libgcc_s_resume) (exc);
>  }
>  
>  _Unwind_Reason_Code
> @@ -59,6 +61,6 @@ __gcc_personality_v0 (int version, _Unwind_Action actions,
>  {
>    if (__glibc_unlikely (libgcc_s_personality == NULL))
>      init ();
> -  return libgcc_s_personality (version, actions, exception_class,
> -			       ue_header, context);
> +  return (*libgcc_s_personality) (version, actions, exception_class,
> +                                  ue_header, context);
>  }

Why do you need this part?

Andreas.
Roland McGrath May 9, 2014, 5:51 p.m. UTC | #2
> Why do you need this part?

It's just unrelated style cleanup I did at the same time.
Andreas Schwab May 9, 2014, 6:12 p.m. UTC | #3
Roland McGrath <roland@hack.frob.com> writes:

>> Why do you need this part?
>
> It's just unrelated style cleanup I did at the same time.

When it's unrelated it should perhaps be put in a separate commit.

Andreas.
Roland McGrath May 9, 2014, 6:14 p.m. UTC | #4
> When it's unrelated it should perhaps be put in a separate commit.

Yes, it should have been.  I was lazy.
diff mbox

Patch

--- a/sysdeps/gnu/unwind-resume.c
+++ b/sysdeps/gnu/unwind-resume.c
@@ -21,7 +21,8 @@ 
 #include <unwind.h>
 #include <gnu/lib-names.h>
 
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc);
+static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
+  __attribute__ ((noreturn));
 static _Unwind_Reason_Code (*libgcc_s_personality)
   (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
    struct _Unwind_Context *);
@@ -37,7 +38,8 @@  init (void)
   if (handle == NULL
       || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
       || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
-    __libc_fatal (LIBGCC_S_SO " must be installed for pthread_cancel to work\n");
+    __libc_fatal (LIBGCC_S_SO
+                  " must be installed for pthread_cancel to work\n");
 
   libgcc_s_resume = resume;
   libgcc_s_personality = personality;
@@ -48,7 +50,7 @@  _Unwind_Resume (struct _Unwind_Exception *exc)
 {
   if (__glibc_unlikely (libgcc_s_resume == NULL))
     init ();
-  libgcc_s_resume (exc);
+  (*libgcc_s_resume) (exc);
 }
 
 _Unwind_Reason_Code
@@ -59,6 +61,6 @@  __gcc_personality_v0 (int version, _Unwind_Action actions,
 {
   if (__glibc_unlikely (libgcc_s_personality == NULL))
     init ();
-  return libgcc_s_personality (version, actions, exception_class,
-			       ue_header, context);
+  return (*libgcc_s_personality) (version, actions, exception_class,
+                                  ue_header, context);
 }