This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [Patch] Silence some compiler warnings.
- From: David Daney <ddaney at avtrex dot com>
- To: tromey at redhat dot com
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 16 May 2007 20:56:22 -0700
- Subject: Re: [Patch] Silence some compiler warnings.
- References: <464B9D88.1010102@avtrex.com> <m3lkfodxjf.fsf@fleche.redhat.com>
Tom Tromey wrote:
"David" == David Daney <ddaney@avtrex.com> writes:
David> Some of the C++ files that make up libgcj are generating compiler
David> warnings. This patch silences them, and also removes a dead union
David> definition that I encountered along the way.
David> Tested on x86_64-pc-linux-gnu with no regressions.
David> OK to commit?
Yes, thanks. One little note...
David> - while (! compare_and_swap (&lock, 0, 1));
David> + while (! compare_and_swap (&lock, 0, 1)) ;
In cases like this I prefer the ';' on its own line, to emphasize the
loop's emptiness. Call it "Sartre style".
Committed thusly:
2007-05-16 David Daney <ddaney@avtrex.com>
* include/java-stack.h (_Jv_FrameInfo): Remove union definition.
(_Jv_StackFrame): Remove commented out code.
(_Jv_UnwindState): Remove superfluous 'typedef'.
* sun/misc/natUnsafe.cc (spinlock): Add white space to quiet
compiler warnings.
* gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
(getCollectionUsage): Don't declare unused parameter n.
(getMemoryManagerNames): Same.
* gnu/gcj/util/natGCInfo.cc (gc_debug_info): Remove superfluous
'typedef'.
Index: include/java-stack.h
===================================================================
--- include/java-stack.h (revision 124782)
+++ include/java-stack.h (working copy)
@@ -49,10 +49,6 @@ struct _Jv_InterpFrameInfo
};
#endif
-union _Jv_FrameInfo
-{
-};
-
struct _Jv_StackFrame
{
_Jv_FrameType type; /* Native or interpreted. */
@@ -69,12 +65,11 @@ struct _Jv_StackFrame
void *start_ip;
};
};
-// _Jv_FrameInfo info; /* Frame-type specific data. */
jclass klass;
_Jv_Method *meth;
};
-typedef struct _Jv_UnwindState;
+struct _Jv_UnwindState;
typedef _Unwind_Reason_Code (*_Jv_TraceFn) (_Jv_UnwindState *);
struct _Jv_UnwindState
Index: sun/misc/natUnsafe.cc
===================================================================
--- sun/misc/natUnsafe.cc (revision 124782)
+++ sun/misc/natUnsafe.cc (working copy)
@@ -31,7 +31,8 @@ public:
spinlock ()
{
- while (! compare_and_swap (&lock, 0, 1));
+ while (! compare_and_swap (&lock, 0, 1))
+ ;
}
~spinlock ()
{
Index: gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc
===================================================================
--- gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc (revision 124782)
+++ gnu/java/lang/management/natVMMemoryPoolMXBeanImpl.cc (working copy)
@@ -20,7 +20,7 @@ details. */
#include <java/lang/UnsupportedOperationException.h>
::java::lang::management::MemoryUsage *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage(jstring)
{
throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 ("gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getCollectionUsage (::java::lang::String *) not implemented"));
}
@@ -41,7 +41,7 @@ gnu::java::lang::management::VMMemoryPoo
JArray< ::java::lang::String *> *
-gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring n)
+gnu::java::lang::management::VMMemoryPoolMXBeanImpl::getMemoryManagerNames(jstring)
{
return (JArray<jstring>*)
JvNewObjectArray(1, &::java::lang::String::class$, JvNewStringLatin1("BoehmGC"));
Index: gnu/gcj/util/natGCInfo.cc
===================================================================
--- gnu/gcj/util/natGCInfo.cc (revision 124782)
+++ gnu/gcj/util/natGCInfo.cc (working copy)
@@ -66,7 +66,7 @@ extern "C" {
static int gc_ok = 1;
-typedef struct gc_debug_info
+struct gc_debug_info
{
int used;
int free;