[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 01/18] ui: avoid compiler warnings from unused clipboard i
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 01/18] ui: avoid compiler warnings from unused clipboard info variable |
Date: |
Wed, 24 Nov 2021 14:33:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 |
On 11/24/21 14:01, 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(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
- [PATCH v4 00/18] tests/docker: start using libvirt-ci's "lcitool" for dockerfiles, Daniel P . Berrangé, 2021/11/24
- [PATCH v4 01/18] ui: avoid compiler warnings from unused clipboard info variable, Daniel P . Berrangé, 2021/11/24
- Re: [PATCH v4 01/18] ui: avoid compiler warnings from unused clipboard info variable,
Philippe Mathieu-Daudé <=
- [PATCH v4 02/18] spice: Update QXLInterface for spice >= 0.15.0, Daniel P . Berrangé, 2021/11/24
- [PATCH v4 03/18] meson: require liburing >= 0.3, Daniel P . Berrangé, 2021/11/24
- [PATCH v4 04/18] ui: avoid warnings about directdb on Alpine / musl libc, Daniel P . Berrangé, 2021/11/24
- [PATCH v4 05/18] ci: explicitly skip I/O tests on alpine, Daniel P . Berrangé, 2021/11/24