OSDN Git Service

nptl: fix compiler warning due to unused-but-set-variable
authorCarmelo Amoroso <carmelo.amoroso@st.com>
Wed, 14 Mar 2012 15:22:19 +0000 (16:22 +0100)
committerCarmelo Amoroso <carmelo.amoroso@st.com>
Mon, 26 Mar 2012 07:57:57 +0000 (09:57 +0200)
gcc 4.6.x raises useful warnings due to unused-but-set-variable,
This patch fixes the following one by using properly preprocessor
guard

libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c: In function '__pthread_cond_timedwait':
libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c:103:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c

index 7f36753..92c6f94 100644 (file)
@@ -100,8 +100,10 @@ __pthread_cond_timedwait (
       {
 #ifdef __NR_clock_gettime
        INTERNAL_SYSCALL_DECL (err);
-       int ret;
-       ret = INTERNAL_SYSCALL (clock_gettime, err, 2,
+# ifndef __ASSUME_POSIX_TIMERS
+       int ret =
+# endif
+       INTERNAL_SYSCALL (clock_gettime, err, 2,
                                (cond->__data.__nwaiters
                                 & ((1 << COND_NWAITERS_SHIFT) - 1)),
                                &rt);