This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Remove unused variable from powerpc sem_post.c
- From: David Miller <davem at davemloft dot net>
- To: joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org, ryan dot arnold at gmail dot com
- Date: Tue, 04 Dec 2012 16:27:35 -0500 (EST)
- Subject: Re: Remove unused variable from powerpc sem_post.c
- References: <Pine.LNX.4.64.1212042124030.17916@digraph.polyomino.org.uk>
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Tue, 4 Dec 2012 21:24:53 +0000
> Similar to an issue I recently fixed in the generic Linux version of
> this file, the powerpc __old_sem_post has a variable used only to
> store the result of atomic_increment_val, resulting in a warning.
> This patch fixes this warning (tested powerpc32) in the same way as
> the fix to the generic file, by casting the result of
> atomic_increment_val to (void) instead of initializing an unused
> variable with it.
>
> 2012-12-04 Joseph Myers <joseph@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/powerpc/sem_post.c (__old_sem_post):
> Cast result of atomic_increment_val to (void) instead of storing
> in otherwise-unused variable.
I thought we had atomics that didn't return a value and therefore could
be used in situations like this, but I guess not.
Looks fine to me.