[Libvir] [PATCH] Clean up a warning in remote_internal.c

After applying this patch, you can compile CVS libvirt with -Werror. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903

On Thu, Dec 06, 2007 at 11:20:15AM +0000, Richard W.M. Jones wrote:
After applying this patch, you can compile CVS libvirt with -Werror.
it's a bit ugly, but +1 Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

"Richard W.M. Jones" <rjones@redhat.com> wrote:
After applying this patch, you can compile CVS libvirt with -Werror.
Rich.
-- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903 Index: src/remote_internal.c =================================================================== RCS file: /data/cvs/libvirt/src/remote_internal.c,v retrieving revision 1.43 diff -u -r1.43 remote_internal.c --- src/remote_internal.c 5 Dec 2007 21:31:07 -0000 1.43 +++ src/remote_internal.c 6 Dec 2007 11:22:21 -0000 @@ -2841,7 +2859,12 @@
static int remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open, - virConnectAuthPtr auth, const char *authtype) + virConnectAuthPtr auth +#if !HAVE_SASL && !HAVE_POLKIT + ATTRIBUTE_UNUSED +#endif + , + const char *authtype)
Ugly indeed. In situations like that, I'd prefer to do something like this: #if !HAVE_SASL && !HAVE_POLKIT # define ATTRIBUTE_UNUSED_SOMETIMES ATTRIBUTE_UNUSED #else # define ATTRIBUTE_UNUSED_SOMETIMES /* empty */ #endif Then if you're unlucky enough to have one or two more affected variables, it doesn't turn into #ifdef hell. static int remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open, virConnectAuthPtr auth, const char *authtype) virConnectAuthPtr auth ATTRIBUTE_UNUSED_SOMETIMES, const char *authtype)
participants (3)
-
Daniel Veillard
-
Jim Meyering
-
Richard W.M. Jones