From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 1/2] ui: avoid compiler warnings from unused clipboard info variable
Date: Wed, 24 Nov 2021 14:04:00 +0100 [thread overview]
Message-ID: <095addd4-99ae-e2be-8ec6-06ee4d2b469e@redhat.com> (raw)
In-Reply-To: <20211123134302.45741-2-berrange@redhat.com>
On 11/23/21 14:43, Daniel P. Berrangé wrote:
> With latest clang 13.0.0 we get
>
> ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-Wunused-but-set-variable]
> g_autoptr(QemuClipboardInfo) old = NULL;
> ^
>
> The compiler can't tell that we only declared this variable in
> order to get the side effect of free'ing it when out of scope.
>
> This pattern is a little dubious for a use of g_autoptr, so
> rewrite the code to avoid it.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> ui/clipboard.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
next prev parent reply other threads:[~2021-11-24 13:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 13:43 [PATCH 0/2 for 6.2] Fix compiler warnings on Fedora 35 / CLang Daniel P. Berrangé
2021-11-23 13:43 ` [PATCH 1/2] ui: avoid compiler warnings from unused clipboard info variable Daniel P. Berrangé
2021-11-23 13:50 ` Richard Henderson
2021-11-23 13:59 ` Philippe Mathieu-Daudé
2021-11-24 13:04 ` Philippe Mathieu-Daudé [this message]
2021-11-23 13:43 ` [PATCH 2/2] spice: Update QXLInterface for spice >= 0.15.0 Daniel P. Berrangé
2021-11-23 13:49 ` Richard Henderson
2021-11-24 13:07 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=095addd4-99ae-e2be-8ec6-06ee4d2b469e@redhat.com \
--to=philmd@redhat.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).