This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Remove unused variable from sem_post.c


nptl/sysdeps/unix/sysv/linux/sem_post.c:__old_sem_post contains code
the initializes a variable nr, otherwise unused, with the result of
atomic_increment_val, so resulting in compiler warnings.  This patch
fixes those by casting to (void) instead of having an unused variable.

Tested on MIPS that this eliminates the compiler warnings.

2012-11-21  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/sem_post.c (__old_sem_post): Cast result
	of atomic_increment_val to (void) instead of storing in
	otherwise-unused variable.

diff --git a/nptl/sysdeps/unix/sysv/linux/sem_post.c b/nptl/sysdeps/unix/sysv/linux/sem_post.c
index 67e8cc5..429d193 100644
--- a/nptl/sysdeps/unix/sysv/linux/sem_post.c
+++ b/nptl/sysdeps/unix/sysv/linux/sem_post.c
@@ -65,7 +65,7 @@ __old_sem_post (sem_t *sem)
 {
   int *futex = (int *) sem;
 
-  int nr = atomic_increment_val (futex);
+  (void) atomic_increment_val (futex);
   /* We always have to assume it is a shared semaphore.  */
   int err = lll_futex_wake (futex, 1, LLL_SHARED);
   if (__builtin_expect (err, 0) < 0)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]