All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: "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>,
	"Daniel P. Berrangé" <berrange@redhat.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 14:16:05 +0100	[thread overview]
Message-ID: <dce310d7-35a6-d3df-734a-c9d184fc282c@gmail.com> (raw)
In-Reply-To: <20220316095248.2613601-1-marcandre.lureau@redhat.com>

On 16/3/22 10:52, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> One less qemu-specific macro. It also helps to make some headers/units
> only depend on glib, and thus moved in standalone projects eventually.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   audio/audio.h                           |  4 +--
>   block/qcow2.h                           |  2 +-
>   bsd-user/qemu.h                         |  2 +-
>   hw/display/qxl.h                        |  2 +-
>   hw/net/rocker/rocker.h                  |  2 +-
>   hw/xen/xen_pt.h                         |  2 +-
>   include/chardev/char-fe.h               |  2 +-
>   include/disas/dis-asm.h                 |  2 +-
>   include/hw/acpi/aml-build.h             | 12 +++----
>   include/hw/core/cpu.h                   |  2 +-
>   include/hw/hw.h                         |  2 +-
>   include/hw/virtio/virtio.h              |  2 +-
>   include/hw/xen/xen-bus-helper.h         |  4 +--
>   include/hw/xen/xen-bus.h                |  4 +--
>   include/hw/xen/xen_common.h             |  2 +-
>   include/hw/xen/xen_pvdev.h              |  2 +-
>   include/monitor/monitor.h               |  4 +--
>   include/qapi/error.h                    | 20 ++++++------
>   include/qapi/qmp/qjson.h                |  8 ++---
>   include/qemu/buffer.h                   |  2 +-
>   include/qemu/compiler.h                 | 11 ++-----
>   include/qemu/error-report.h             | 24 +++++++-------
>   include/qemu/log-for-trace.h            |  2 +-
>   include/qemu/log.h                      |  2 +-
>   include/qemu/qemu-print.h               |  8 ++---
>   include/qemu/readline.h                 |  2 +-
>   qga/guest-agent-core.h                  |  2 +-
>   qga/vss-win32/requester.h               |  2 +-
>   scripts/cocci-macro-file.h              |  2 +-
>   tests/qtest/libqos/libqtest.h           | 42 ++++++++++++-------------
>   tests/qtest/libqtest-single.h           |  2 +-
>   tests/qtest/migration-helpers.h         |  6 ++--
>   audio/alsaaudio.c                       |  4 +--
>   audio/dsoundaudio.c                     |  4 +--
>   audio/ossaudio.c                        |  4 +--
>   audio/paaudio.c                         |  2 +-
>   audio/sdlaudio.c                        |  2 +-
>   block/blkverify.c                       |  2 +-
>   block/ssh.c                             |  4 +--
>   fsdev/9p-marshal.c                      |  2 +-
>   fsdev/virtfs-proxy-helper.c             |  2 +-
>   hw/9pfs/9p.c                            |  2 +-
>   hw/acpi/aml-build.c                     |  4 +--
>   hw/mips/fuloong2e.c                     |  2 +-
>   hw/mips/malta.c                         |  2 +-
>   hw/net/rtl8139.c                        |  2 +-
>   hw/virtio/virtio.c                      |  2 +-
>   io/channel-websock.c                    |  2 +-
>   monitor/hmp.c                           |  4 +--
>   nbd/server.c                            | 10 +++---
>   qemu-img.c                              |  4 +--
>   qemu-io.c                               |  2 +-
>   qobject/json-parser.c                   |  2 +-
>   softmmu/qtest.c                         |  4 +--
>   tests/qtest/libqtest.c                  |  2 +-
>   tests/unit/test-qobject-input-visitor.c |  4 +--
>   audio/coreaudio.m                       |  4 +--
>   scripts/checkpatch.pl                   |  2 +-
>   58 files changed, 130 insertions(+), 137 deletions(-)

> 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

Can we also poison GCC_FMT_ATTR? Maybe split in 2 patches, 1 converting
and another removing unused & poisoning?


WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <philippe.mathieu.daude@gmail.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Richard W.M. Jones" <rjones@redhat.com>,
	"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>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <huth@tuxfamily.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"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 14:16:05 +0100	[thread overview]
Message-ID: <dce310d7-35a6-d3df-734a-c9d184fc282c@gmail.com> (raw)
In-Reply-To: <20220316095248.2613601-1-marcandre.lureau@redhat.com>

On 16/3/22 10:52, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> One less qemu-specific macro. It also helps to make some headers/units
> only depend on glib, and thus moved in standalone projects eventually.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   audio/audio.h                           |  4 +--
>   block/qcow2.h                           |  2 +-
>   bsd-user/qemu.h                         |  2 +-
>   hw/display/qxl.h                        |  2 +-
>   hw/net/rocker/rocker.h                  |  2 +-
>   hw/xen/xen_pt.h                         |  2 +-
>   include/chardev/char-fe.h               |  2 +-
>   include/disas/dis-asm.h                 |  2 +-
>   include/hw/acpi/aml-build.h             | 12 +++----
>   include/hw/core/cpu.h                   |  2 +-
>   include/hw/hw.h                         |  2 +-
>   include/hw/virtio/virtio.h              |  2 +-
>   include/hw/xen/xen-bus-helper.h         |  4 +--
>   include/hw/xen/xen-bus.h                |  4 +--
>   include/hw/xen/xen_common.h             |  2 +-
>   include/hw/xen/xen_pvdev.h              |  2 +-
>   include/monitor/monitor.h               |  4 +--
>   include/qapi/error.h                    | 20 ++++++------
>   include/qapi/qmp/qjson.h                |  8 ++---
>   include/qemu/buffer.h                   |  2 +-
>   include/qemu/compiler.h                 | 11 ++-----
>   include/qemu/error-report.h             | 24 +++++++-------
>   include/qemu/log-for-trace.h            |  2 +-
>   include/qemu/log.h                      |  2 +-
>   include/qemu/qemu-print.h               |  8 ++---
>   include/qemu/readline.h                 |  2 +-
>   qga/guest-agent-core.h                  |  2 +-
>   qga/vss-win32/requester.h               |  2 +-
>   scripts/cocci-macro-file.h              |  2 +-
>   tests/qtest/libqos/libqtest.h           | 42 ++++++++++++-------------
>   tests/qtest/libqtest-single.h           |  2 +-
>   tests/qtest/migration-helpers.h         |  6 ++--
>   audio/alsaaudio.c                       |  4 +--
>   audio/dsoundaudio.c                     |  4 +--
>   audio/ossaudio.c                        |  4 +--
>   audio/paaudio.c                         |  2 +-
>   audio/sdlaudio.c                        |  2 +-
>   block/blkverify.c                       |  2 +-
>   block/ssh.c                             |  4 +--
>   fsdev/9p-marshal.c                      |  2 +-
>   fsdev/virtfs-proxy-helper.c             |  2 +-
>   hw/9pfs/9p.c                            |  2 +-
>   hw/acpi/aml-build.c                     |  4 +--
>   hw/mips/fuloong2e.c                     |  2 +-
>   hw/mips/malta.c                         |  2 +-
>   hw/net/rtl8139.c                        |  2 +-
>   hw/virtio/virtio.c                      |  2 +-
>   io/channel-websock.c                    |  2 +-
>   monitor/hmp.c                           |  4 +--
>   nbd/server.c                            | 10 +++---
>   qemu-img.c                              |  4 +--
>   qemu-io.c                               |  2 +-
>   qobject/json-parser.c                   |  2 +-
>   softmmu/qtest.c                         |  4 +--
>   tests/qtest/libqtest.c                  |  2 +-
>   tests/unit/test-qobject-input-visitor.c |  4 +--
>   audio/coreaudio.m                       |  4 +--
>   scripts/checkpatch.pl                   |  2 +-
>   58 files changed, 130 insertions(+), 137 deletions(-)

> 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

Can we also poison GCC_FMT_ATTR? Maybe split in 2 patches, 1 converting
and another removing unused & poisoning?


  parent reply	other threads:[~2022-03-16 13:16 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é [this message]
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é
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=dce310d7-35a6-d3df-734a-c9d184fc282c@gmail.com \
    --to=philippe.mathieu.daude@gmail.com \
    --cc=ani@anisinha.ca \
    --cc=anthony.perard@citrix.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --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.