[git commit] fix a bunch of build warnings

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Fri Jun 15 12:00:29 UTC 2012


commit: http://git.uclibc.org/uClibc/commit/?id=e9af4dfbd328e9f3bba235fdb2d1027dd2dbbcde
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Added attribute_noreturn even if it has return at the end of function

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
---
 libc/inet/resolv.c                                 |    6 ++++--
 libpthread/nptl/cleanup_routine.c                  |    2 +-
 libpthread/nptl/pt-cleanup.c                       |    2 +-
 libpthread/nptl/pthread_create.c                   |    2 +-
 libpthread/nptl/pthread_exit.c                     |    2 +-
 libpthread/nptl/pthread_getspecific.c              |    2 +-
 libpthread/nptl/sysdeps/pthread/pthread.h          |    1 +
 .../nptl/sysdeps/unix/sysv/linux/mq_notify.c       |    2 +-
 .../nptl/sysdeps/unix/sysv/linux/timer_routines.c  |    2 +-
 libpthread/nptl/unwind.c                           |    4 ++--
 10 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index b4246d3..692991f 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -3532,7 +3532,7 @@ __res_vinit(res_state rp, int preinit)
 	return 0;
 }
 
-static void
+static void attribute_noreturn
 __res_iclose(void)
 {
 	__UCLIBC_MUTEX_LOCK(__resolv_lock);
@@ -3551,7 +3551,9 @@ __res_iclose(void)
 	}
 #endif
 	memset(&_res, 0, sizeof(_res));
-	__UCLIBC_MUTEX_UNLOCK(__resolv_lock);
+	/* the loop is only to make gcc happy */
+	while(1)
+		__UCLIBC_MUTEX_UNLOCK(__resolv_lock);
 }
 
 /*
diff --git a/libpthread/nptl/cleanup_routine.c b/libpthread/nptl/cleanup_routine.c
index cbf2318..54badf0 100644
--- a/libpthread/nptl/cleanup_routine.c
+++ b/libpthread/nptl/cleanup_routine.c
@@ -19,7 +19,7 @@
 
 #include <pthread.h>
 
-
+void __pthread_cleanup_routine (struct __pthread_cleanup_frame *f);
 void
 __pthread_cleanup_routine (struct __pthread_cleanup_frame *f)
 {
diff --git a/libpthread/nptl/pt-cleanup.c b/libpthread/nptl/pt-cleanup.c
index d7394ae..aa0b9bb 100644
--- a/libpthread/nptl/pt-cleanup.c
+++ b/libpthread/nptl/pt-cleanup.c
@@ -23,7 +23,7 @@
 #include <jmpbuf-unwind.h>
 
 void
-attribute_protected
+/*does not apply due to hidden_proto(): attribute_protected*/
 __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
 {
   struct pthread *self = THREAD_SELF;
diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c
index b3bf475..695d1a9 100644
--- a/libpthread/nptl/pthread_create.c
+++ b/libpthread/nptl/pthread_create.c
@@ -221,7 +221,7 @@ __free_tcb (struct pthread *pd)
 }
 
 
-static int
+static int attribute_noreturn
 start_thread (void *arg)
 {
   struct pthread *pd = (struct pthread *) arg;
diff --git a/libpthread/nptl/pthread_exit.c b/libpthread/nptl/pthread_exit.c
index 88d3859..98f67f2 100644
--- a/libpthread/nptl/pthread_exit.c
+++ b/libpthread/nptl/pthread_exit.c
@@ -22,7 +22,7 @@
 
 
 void
-attribute_protected
+attribute_protected attribute_noreturn
 __pthread_exit (void* value)
 {
   THREAD_SETMEM (THREAD_SELF, result, value);
diff --git a/libpthread/nptl/pthread_getspecific.c b/libpthread/nptl/pthread_getspecific.c
index 639a4fd..a00fe0b 100644
--- a/libpthread/nptl/pthread_getspecific.c
+++ b/libpthread/nptl/pthread_getspecific.c
@@ -21,8 +21,8 @@
 #include "pthreadP.h"
 
 
-void *
 attribute_protected
+void *
 __pthread_getspecific (pthread_key_t key)
 {
   struct pthread_key_data *data;
diff --git a/libpthread/nptl/sysdeps/pthread/pthread.h b/libpthread/nptl/sysdeps/pthread/pthread.h
index 98c84ae..1ebf130 100644
--- a/libpthread/nptl/sysdeps/pthread/pthread.h
+++ b/libpthread/nptl/sysdeps/pthread/pthread.h
@@ -581,6 +581,7 @@ class __pthread_cleanup_class
    function the compiler is free to decide inlining the change when
    needed or fall back on the copy which must exist somewhere
    else.  */
+void __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame);
 __extern_inline void
 __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
 {
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c b/libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c
index 188040e..91d40a3 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mq_notify.c
@@ -111,7 +111,7 @@ notification_function (void *arg)
 
 
 /* Helper thread.  */
-static void *
+static attribute_noreturn void *
 helper_thread (void *arg)
 {
   while (1)
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
index 4319d8d..1664af5 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/timer_routines.c
@@ -69,7 +69,7 @@ timer_sigev_thread (void *arg)
 
 
 /* Helper function to support starting threads for SIGEV_THREAD.  */
-static void *
+static attribute_noreturn void *
 timer_helper_thread (void *arg)
 {
   /* Wait for the SIGTIMER signal, allowing the setXid signal, and
diff --git a/libpthread/nptl/unwind.c b/libpthread/nptl/unwind.c
index 671d702..3952885 100644
--- a/libpthread/nptl/unwind.c
+++ b/libpthread/nptl/unwind.c
@@ -99,7 +99,7 @@ unwind_stop (int version, _Unwind_Action actions,
 }
 
 
-static void
+static attribute_noreturn void
 unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc)
 {
   /* When we get here a C++ catch block didn't rethrow the object.  We
@@ -115,7 +115,7 @@ unwind_cleanup (_Unwind_Reason_Code reason, struct _Unwind_Exception *exc)
 
 
 void
-attribute_protected
+/*does not apply due to hidden_proto(): attribute_protected*/
 __cleanup_fct_attribute __attribute ((noreturn))
 #if !defined SHARED && !defined IS_IN_libpthread
 weak_function


More information about the uClibc-cvs mailing list