[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Move unused parameter warning suppression into a macro

From: Branko Čibej <brane_at_xbc.nu>
Date: 2005-10-25 09:58:28 CEST

Jonathan Gilbert wrote:

>At David James recommendation, I have placed the macro into svn_types.h.
>This seemed the least illogical place to put it, but none of the existing
>headers were really a perfect match. :-)
>
>Log:
>
>Move unused parameter warning suppression into a macro instead of directly
>using "(void)p;" or "p=p;" in otherwise semantically-oriented source code.
>
>Index: subversion/include/svn_types.h
>===================================================================
>--- subversion/include/svn_types.h (revision 16987)
>+++ subversion/include/svn_types.h (working copy)
>@@ -84,6 +84,16 @@
>
> /** @} */
>
>+/** A macro to suppress some compilers' "Parameter is not used" warnings */
>+#ifndef SVN_UNUSED_PARAMETER
>+#define SVN_UNUSED_PARAMETER(x) ((void)x)
>+/* Possible alternative:
>+ *
>+ * #define SVN_UNUSED_PARAMETER(x) ((x) = (x))
>+ */
>+#endif /* SVN_UNUSED_PARAMETER */
>
>
You don't need the #ifndef; we own the SVN_* namespace, and it's
certainly better to get a compiler warning that to have the macro
silently defined to something entirely different. :)

Otherwise, +1.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 25 10:04:46 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.