This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH, libjava: eliminate warning
- From: Ben Elliston <bje at au1 dot ibm dot com>
- To: java <java at gcc dot gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org, aph at redhat dot com
- Date: Thu, 26 Nov 2009 16:25:42 +1100
- Subject: PATCH, libjava: eliminate warning
This warning was introduced by Andrew's Nov 17 patch.
Okay for mainline?
Ben
2009-11-26 Ben Elliston <bje@au.ibm.com>
* posix-threads.cc (ParkHelper::unpark): Do not initialise result,
but assign it instead. Eliminates an unused variable warning when
the result == 0 assertion is disabled.
Index: posix-threads.cc
===================================================================
--- posix-threads.cc (revision 154668)
+++ posix-threads.cc (working copy)
@@ -365,8 +365,9 @@ ParkHelper::unpark ()
if (compare_and_swap
(ptr, Thread::THREAD_PARK_PARKED, Thread::THREAD_PARK_RUNNING))
{
+ int result;
pthread_mutex_lock (&mutex);
- int result = pthread_cond_signal (&cond);
+ result = pthread_cond_signal (&cond);
pthread_mutex_unlock (&mutex);
JvAssert (result == 0);
}