From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Thomas Huth" <huth@tuxfamily.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Richard W.M. Jones" <rjones@redhat.com>,
"Warner Losh" <imp@bsdimp.com>, "Kyle Evans" <kevans@freebsd.org>,
"Greg Kurz" <groug@kaod.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Ani Sinha" <ani@anisinha.ca>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Jiri Pirko" <jiri@resnulli.us>,
"Jason Wang" <jasowang@redhat.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony Perard" <anthony.perard@citrix.com>,
"Paul Durrant" <paul@xen.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Konstantin Kostiuk" <kkostiuk@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"open list:blkverify" <qemu-block@nongnu.org>,
"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 07/27] Replace GCC_FMT_ATTR with G_GNUC_PRINTF
Date: Wed, 16 Mar 2022 13:29:17 +0000 [thread overview]
Message-ID: <YjHmLTI+geU4S9Wq@redhat.com> (raw)
In-Reply-To: <20220316095248.2613601-1-marcandre.lureau@redhat.com>
On Wed, Mar 16, 2022 at 01:52:48PM +0400, marcandre.lureau@redhat.com wrote:
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 3baa5e3790f7..f2bd050e3b9a 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -79,19 +79,12 @@
> #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \
> sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)))
>
> -#if defined(__clang__)
> -/* clang doesn't support gnu_printf, so use printf. */
> -# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
> -#else
> -/* Use gnu_printf (qemu uses standard format strings). */
> -# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
> -# if defined(_WIN32)
> +#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
> +# define __printf__ __gnu_printf__
> #endif
I'm not convinced we shold have this remaining define, even
before your patch.
For code we've implemented, we should have used __gnu_printf__
already if we know it uses GNU format on Windows.
For code in GLib, its header file uses __gnu_printf__ for anything
that relies on its portable printf replacement, which is basically
everything in GLib.
For anything else we should honour whatever they declare, and not
assume their impl is the GNU one.
I guess it is easy enough to validate by deleting this and seeing
if we get any warnings from the mingw CI jobs about printf/gnu_printf
mismatch.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
WARNING: multiple messages have this Message-ID (diff)
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Konstantin Kostiuk" <kkostiuk@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Ani Sinha" <ani@anisinha.ca>, "Eric Blake" <eblake@redhat.com>,
"Warner Losh" <imp@bsdimp.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"open list:blkverify" <qemu-block@nongnu.org>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Anthony Perard" <anthony.perard@citrix.com>,
"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>,
"Laurent Vivier" <lvivier@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Jiri Pirko" <jiri@resnulli.us>,
"Kyle Evans" <kevans@freebsd.org>, "Greg Kurz" <groug@kaod.org>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
"Paul Durrant" <paul@xen.org>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Thomas Huth" <huth@tuxfamily.org>,
"Richard W.M. Jones" <rjones@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: Re: [PATCH 07/27] Replace GCC_FMT_ATTR with G_GNUC_PRINTF
Date: Wed, 16 Mar 2022 13:29:17 +0000 [thread overview]
Message-ID: <YjHmLTI+geU4S9Wq@redhat.com> (raw)
In-Reply-To: <20220316095248.2613601-1-marcandre.lureau@redhat.com>
On Wed, Mar 16, 2022 at 01:52:48PM +0400, marcandre.lureau@redhat.com wrote:
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 3baa5e3790f7..f2bd050e3b9a 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -79,19 +79,12 @@
> #define QEMU_BUILD_BUG_ON_ZERO(x) (sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)) - \
> sizeof(QEMU_BUILD_BUG_ON_STRUCT(x)))
>
> -#if defined(__clang__)
> -/* clang doesn't support gnu_printf, so use printf. */
> -# define GCC_FMT_ATTR(n, m) __attribute__((format(printf, n, m)))
> -#else
> -/* Use gnu_printf (qemu uses standard format strings). */
> -# define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
> -# if defined(_WIN32)
> +#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
> +# define __printf__ __gnu_printf__
> #endif
I'm not convinced we shold have this remaining define, even
before your patch.
For code we've implemented, we should have used __gnu_printf__
already if we know it uses GNU format on Windows.
For code in GLib, its header file uses __gnu_printf__ for anything
that relies on its portable printf replacement, which is basically
everything in GLib.
For anything else we should honour whatever they declare, and not
assume their impl is the GNU one.
I guess it is easy enough to validate by deleting this and seeing
if we get any warnings from the mingw CI jobs about printf/gnu_printf
mismatch.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2022-03-16 13:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-16 9:52 [PATCH 07/27] Replace GCC_FMT_ATTR with G_GNUC_PRINTF marcandre.lureau
2022-03-16 9:52 ` marcandre.lureau
2022-03-16 12:07 ` Richard W.M. Jones
2022-03-16 12:07 ` Richard W.M. Jones
2022-03-16 13:16 ` Philippe Mathieu-Daudé
2022-03-16 13:16 ` Philippe Mathieu-Daudé
2022-03-16 13:28 ` Thomas Huth
2022-03-16 13:28 ` Thomas Huth
2022-03-16 19:49 ` Marc-André Lureau
2022-03-16 19:49 ` Marc-André Lureau
2022-03-16 13:29 ` Daniel P. Berrangé [this message]
2022-03-16 13:29 ` Daniel P. Berrangé
2022-03-16 13:33 ` Marc-André Lureau
2022-03-16 13:33 ` Marc-André Lureau
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=YjHmLTI+geU4S9Wq@redhat.com \
--to=berrange@redhat.com \
--cc=ani@anisinha.ca \
--cc=anthony.perard@citrix.com \
--cc=armbru@redhat.com \
--cc=aurelien@aurel32.net \
--cc=chenhuacai@kernel.org \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=f4bug@amsat.org \
--cc=groug@kaod.org \
--cc=hreitz@redhat.com \
--cc=huth@tuxfamily.org \
--cc=imammedo@redhat.com \
--cc=imp@bsdimp.com \
--cc=jasowang@redhat.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jiri@resnulli.us \
--cc=kevans@freebsd.org \
--cc=kkostiuk@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=rjones@redhat.com \
--cc=sstabellini@kernel.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.com \
--cc=wangyanan55@huawei.com \
--cc=xen-devel@lists.xenproject.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 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.