public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH, libjava: eliminate warning
@ 2009-11-26  5:25 Ben Elliston
  2009-11-26  9:54 ` Andrew Haley
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Elliston @ 2009-11-26  5:25 UTC (permalink / raw)
  To: java; +Cc: gcc-patches, aph

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);
     }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH, libjava: eliminate warning
  2009-11-26  5:25 PATCH, libjava: eliminate warning Ben Elliston
@ 2009-11-26  9:54 ` Andrew Haley
  2009-11-26 12:27   ` Ben Elliston
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Haley @ 2009-11-26  9:54 UTC (permalink / raw)
  To: Ben Elliston; +Cc: java, gcc-patches

Ben Elliston wrote:
> 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.

Gag.  Unused variable warning considered harmful.

OK.  :-)

Andrew.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH, libjava: eliminate warning
  2009-11-26  9:54 ` Andrew Haley
@ 2009-11-26 12:27   ` Ben Elliston
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Elliston @ 2009-11-26 12:27 UTC (permalink / raw)
  To: Andrew Haley; +Cc: java, gcc-patches

On Thu, 2009-11-26 at 09:54 +0000, Andrew Haley wrote:

> Gag.  Unused variable warning considered harmful.

I can remove all of the trailing whitespace if you prefer. :-)
Committed, thanks,

Ben

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-26 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-26  5:25 PATCH, libjava: eliminate warning Ben Elliston
2009-11-26  9:54 ` Andrew Haley
2009-11-26 12:27   ` Ben Elliston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).