From 131298a1b334b9f4b82f8561d5703b6d02ab338c Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Thu, 16 Jul 2009 13:06:26 -0700 Subject: [PATCH] Bug 501840 - Avoid a warning when a cycle collection participant doesn't use tmp. r+sr=peterv --- xpcom/glue/nsCycleCollectionParticipant.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index 86b5e599a73..9fa4c4579ea 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -481,7 +481,11 @@ public: #define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(_field) \ NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->_field) +// NB: The (void)tmp; hack in the TRACE_END macro exists to support +// implementations that don't need to do anything in their Trace method. +// Without this hack, some compilers warn about the unused tmp local. #define NS_IMPL_CYCLE_COLLECTION_TRACE_END \ + (void)tmp; \ } ///////////////////////////////////////////////////////////////////////////////