Browse Source

fix a bunch of build warnings

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

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 13 years ago
parent
commit
e9af4dfbd3

+ 4 - 2
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);
 }
 
 /*

+ 1 - 1
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)
 {

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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);

+ 1 - 1
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;

+ 1 - 0
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)
 {

+ 1 - 1
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)

+ 1 - 1
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

+ 2 - 2
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