[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaroun
From: |
Peter Maydell |
Subject: |
Re: [PATCH 05/12] compiler.h: drop __printf__ macro MinGW/glib workaround |
Date: |
Thu, 24 Feb 2022 19:12:23 +0000 |
On Thu, 24 Feb 2022 at 18:38, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> This workaround was added in commit 95df51a4 ("w32: Always use standard
> instead of native format strings"), as it claimed glib was using
> __printf__ attribute. This is surprising, since glib has always used
> G_GNUC_PRINTF which, as the name implies, uses __gnu_printf__ when
> possible.
This was not always true: before this commit from 2018
https://github.com/GNOME/glib/commit/98a0ab929d8c59ee27e5f470f11d077bb6a56749
G_GNUC_PRINTF used always used __printf__.
I think that change only landed in glib 2.58, so since our current
minimum glib version is 2.56 we need to retain this workaround.
> Apparently, the workaound is no longer relevant though, I don't see
> the warnings.
You're probably building with a newer glib, and possibly also
a newer mingw.
I've cc'd Stefan Weil who might know whether we can drop this
workaround as far as the mingw part is concerned.
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> include/qemu/compiler.h | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 2704c314dcac..eb29b72c14d7 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -73,14 +73,6 @@
> #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \
> sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)))
>
> -#if !defined(__clang__) && defined(_WIN32)
> -/*
> - * Map __printf__ to __gnu_printf__ because we want standard format strings
> even
> - * when MinGW or GLib include files use __printf__.
> - */
> -# define __printf__ __gnu_printf__
> -#endif
> -
> #ifndef __has_warning
> #define __has_warning(x) 0 /* compatibility with non-clang compilers */
> #endif
> --
> 2.35.1.273.ge6ebfd0e8cbb
thanks
-- PMM
- Re: [PATCH 01/12] compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT, (continued)
[PATCH 06/12] Replace config-time define HOST_WORDS_BIGENDIAN, marcandre . lureau, 2022/02/24
[PATCH 09/12] scripts/modinfo-collect: remove unused/dead code, marcandre . lureau, 2022/02/24
[PATCH 08/12] Move HOST_LONG_BITS to compiler.h, marcandre . lureau, 2022/02/24