qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf'
Date: Mon, 28 Sep 2020 15:39:14 +0100	[thread overview]
Message-ID: <20200928143914.GK2230076@redhat.com> (raw)
In-Reply-To: <CAFEAcA8dSc+L5Xv=sV_C-wtpddoYq7dZd2UN_-X6KgunxkZQAQ@mail.gmail.com>

On Mon, Sep 28, 2020 at 03:32:45PM +0100, Peter Maydell wrote:
> On Mon, 28 Sep 2020 at 15:23, Daniel P. Berrangé <berrange@redhat.com> wrote:
> >
> > On Mon, Sep 28, 2020 at 03:14:45PM +0100, Peter Maydell wrote:
> > > On Mon, 28 Sep 2020 at 15:06, Daniel P. Berrangé <berrange@redhat.com> wrote:
> > > > I think this can be simplified even more by using GLib's macros
> > > >
> > > >   #define GCC_FMT_ATTR(n, m)  G_GNUC_PRINTF(n, m)
> > >
> > > At least on my system G_GNUC_PRINTF() expands to
> > > __format__(__printf__,...), not gnu_printf, so it is
> > > not quite what we want. (The difference is that on Windows
> > > hosts we still want to mark up our our logging functions as
> > > taking the glibc style format handling, not whatever the
> > > MS C library format escapes happen to be.)
> > > At a minimum you'd need to keep in the "on Windows,
> > > redefine __printf__ to __gnu_printf__" logic.
> > >
> > > See also commit 95df51a4a02a853.
> >
> > Oh, that's a bug in old GLib versions. I thought we had a new enough
> > min to avoid that problem, but i guess not after all.
> 
> Looks like the implementation changed 2 years ago:
> https://gitlab.gnome.org/GNOME/glib/-/commit/98a0ab929d8c59ee27e5f470f11d077bb6a56749
> not sure which glib version that would correspond to.

Looks like 2.58.0, which is still a fair bit newer than our 2.48 min.

NB, only the macro changed - they were using GNU printf impl for many
many years before that but simply had the wrong macro definition

We can just sacrifice -Wformat checking for Windows builds when using
old GLib. People building natively on Windows with MSys probably have
brand new GLib, and those using Fedora mingw / Debian MXE also have
pretty new GLib.

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 :|



  reply	other threads:[~2020-09-28 14:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 12:58 [PATCH 0/3] qemu/compiler: Remove unused special case code for GCC < 4.8 Philippe Mathieu-Daudé
2020-09-28 12:58 ` [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf' Philippe Mathieu-Daudé
2020-09-28 13:43   ` Peter Maydell
2020-09-28 14:04   ` Daniel P. Berrangé
2020-09-28 14:14     ` Peter Maydell
2020-09-28 14:23       ` Daniel P. Berrangé
2020-09-28 14:32         ` Peter Maydell
2020-09-28 14:39           ` Daniel P. Berrangé [this message]
2020-09-28 16:49             ` Paolo Bonzini
2020-09-28 12:58 ` [PATCH 2/3] qemu/atomic: Drop special case for unsupported compiler Philippe Mathieu-Daudé
2020-09-28 13:36   ` Peter Maydell
2020-11-25 15:07     ` Marc-André Lureau
2020-09-28 12:58 ` [PATCH 3/3] accel/tcg: Remove special case for GCC < 4.6 Philippe Mathieu-Daudé
2020-09-28 13:52   ` Peter Maydell

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=20200928143914.GK2230076@redhat.com \
    --to=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).