* [Qemu-devel] [PATCH 08/11] vnc: avoid write only variables
@ 2010-10-06 21:33 Blue Swirl
2010-10-07 7:23 ` [Qemu-devel] " Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Blue Swirl @ 2010-10-06 21:33 UTC (permalink / raw)
To: qemu-devel, Anthony Liguori
Compiling with GCC 4.6.0 20100925 produced warnings:
/src/qemu/ui/vnc.c: In function 'vnc_client_cache_auth':
/src/qemu/ui/vnc.c:217:12: error: variable 'qdict' set but not used
[-Werror=unused-but-set-variable]
/src/qemu/ui/vnc.c: In function 'vnc_display_open':
/src/qemu/ui/vnc.c:2526:9: error: variable 'acl' set but not used
[-Werror=unused-but-set-variable]
Fix by making the variable declarations and their uses also conditional
to debug definition.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
ui/vnc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/ui/vnc.c b/ui/vnc.c
index c7a1831..864342e 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -214,13 +214,17 @@ static int vnc_server_info_put(QDict *qdict)
static void vnc_client_cache_auth(VncState *client)
{
+#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
QDict *qdict;
+#endif
if (!client->info) {
return;
}
+#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
qdict = qobject_to_qdict(client->info);
+#endif
#ifdef CONFIG_VNC_TLS
if (client->tls.session &&
@@ -2523,7 +2527,9 @@ int vnc_display_open(DisplayState *ds, const
char *display)
int sasl = 0;
int saslErr;
#endif
+#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
int acl = 0;
+#endif
int lock_key_sync = 1;
if (!vnc_display)
@@ -2581,8 +2587,10 @@ int vnc_display_open(DisplayState *ds, const
char *display)
return -1;
}
#endif
+#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
} else if (strncmp(options, "acl", 3) == 0) {
acl = 1;
+#endif
} else if (strncmp(options, "lossy", 5) == 0) {
vs->lossy = true;
}
--
1.6.2.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [PATCH 08/11] vnc: avoid write only variables
2010-10-06 21:33 [Qemu-devel] [PATCH 08/11] vnc: avoid write only variables Blue Swirl
@ 2010-10-07 7:23 ` Paolo Bonzini
2010-10-07 12:26 ` Markus Armbruster
2010-10-07 18:04 ` Blue Swirl
0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2010-10-07 7:23 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
On 10/06/2010 11:33 PM, Blue Swirl wrote:
> +#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
> } else if (strncmp(options, "acl", 3) == 0) {
> acl = 1;
> +#endif
Not sure it's okay to reject the option altogether (i.e. maybe the #if
should only include "acl = 1".
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 08/11] vnc: avoid write only variables
2010-10-07 7:23 ` [Qemu-devel] " Paolo Bonzini
@ 2010-10-07 12:26 ` Markus Armbruster
2010-10-07 18:04 ` Blue Swirl
1 sibling, 0 replies; 4+ messages in thread
From: Markus Armbruster @ 2010-10-07 12:26 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Blue Swirl, qemu-devel
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 10/06/2010 11:33 PM, Blue Swirl wrote:
>> +#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
>> } else if (strncmp(options, "acl", 3) == 0) {
>> acl = 1;
>> +#endif
>
> Not sure it's okay to reject the option altogether (i.e. maybe the #if
Technically a regression. Do we care?
> should only include "acl = 1".
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Re: [PATCH 08/11] vnc: avoid write only variables
2010-10-07 7:23 ` [Qemu-devel] " Paolo Bonzini
2010-10-07 12:26 ` Markus Armbruster
@ 2010-10-07 18:04 ` Blue Swirl
1 sibling, 0 replies; 4+ messages in thread
From: Blue Swirl @ 2010-10-07 18:04 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Thu, Oct 7, 2010 at 7:23 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 10/06/2010 11:33 PM, Blue Swirl wrote:
>>
>> +#if defined(CONFIG_VNC_TLS) || defined(CONFIG_VNC_SASL)
>> } else if (strncmp(options, "acl", 3) == 0) {
>> acl = 1;
>> +#endif
>
> Not sure it's okay to reject the option altogether (i.e. maybe the #if
> should only include "acl = 1".
It's OK with current code, it doesn't check for invalid options. This
also matches how other options are handled.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-07 18:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 21:33 [Qemu-devel] [PATCH 08/11] vnc: avoid write only variables Blue Swirl
2010-10-07 7:23 ` [Qemu-devel] " Paolo Bonzini
2010-10-07 12:26 ` Markus Armbruster
2010-10-07 18:04 ` Blue Swirl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.