This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Remove unused variable from pthread_cond_timedwait.c
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Wed, 21 Nov 2012 17:17:04 +0000
- Subject: Remove unused variable from pthread_cond_timedwait.c
nptl/pthread_cond_timedwait.c results in warnings about a
set-but-not-used variable "ret", used to store the result of
INTERNAL_VSYSCALL. Nothing in this file uses this return value under
any circumstances; this patch changes it to cast the return to (void),
similar to the other half of the containing #if where the gettimeofday
return value is cast to (void).
Tested on MIPS that this eliminates the compiler warnings.
2012-11-21 Joseph Myers <joseph@codesourcery.com>
* pthread_cond_timedwait.c (__pthread_cond_timedwait)
[__NR_clock_gettime]: Cast result of INTERNAL_VSYSCALL to void
instead of storing in otherwise-unused variable.
diff --git a/nptl/pthread_cond_timedwait.c b/nptl/pthread_cond_timedwait.c
index 2fcbc57..ef33b96 100644
--- a/nptl/pthread_cond_timedwait.c
+++ b/nptl/pthread_cond_timedwait.c
@@ -115,11 +115,10 @@ __pthread_cond_timedwait (cond, mutex, abstime)
{
# ifdef __NR_clock_gettime
INTERNAL_SYSCALL_DECL (err);
- int ret;
- ret = INTERNAL_VSYSCALL (clock_gettime, err, 2,
- (cond->__data.__nwaiters
- & ((1 << COND_NWAITERS_SHIFT) - 1)),
- &rt);
+ (void) INTERNAL_VSYSCALL (clock_gettime, err, 2,
+ (cond->__data.__nwaiters
+ & ((1 << COND_NWAITERS_SHIFT) - 1)),
+ &rt);
/* Convert the absolute timeout value to a relative timeout. */
rt.tv_sec = abstime->tv_sec - rt.tv_sec;
rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
--
Joseph S. Myers
joseph@codesourcery.com