qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, Stefan Weil <sw@weilnetz.de>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qjson.h: Remove GCC_FMT_ATTR markup from qobject_from_jsonv() declaration
Date: Wed, 05 Mar 2014 23:47:23 +0100	[thread overview]
Message-ID: <5317A97B.4070108@redhat.com> (raw)
In-Reply-To: <531792E8.5080901@redhat.com>

Il 05/03/2014 22:11, Eric Blake ha scritto:
> On 03/05/2014 02:02 PM, Stefan Weil wrote:
>> Commit aa830cdc28edb69c1fe81c8fd9471ab288ad0926 removed that attribute
>> from qobject_from_json. Now gcc suggests to add it again when compiler
>> flag -Wmissing-format-attribute is used:
>>
>> qobject/qjson.c: In function ‘qobject_from_json’:
>> qobject/qjson.c:53:5: error:
>>  function might be possible candidate for ‘gnu_printf’ format attribute
>>  [-Werror=suggest-attribute=format]
>>
>> Fix this by removing the flag from qobject_from_jsonv, too.
>
> NAK.
>
> qobject_from_jsonv needs the attribute.
>
> Maybe this is a better approach (untested):
>
> diff --git i/qobject/qjson.c w/qobject/qjson.c
> index 6cf2511..f9616f8 100644
> --- i/qobject/qjson.c
> +++ w/qobject/qjson.c
> @@ -50,7 +50,7 @@ QObject *qobject_from_jsonv(const char *string,
> va_list *ap)
>
>  QObject *qobject_from_json(const char *string)
>  {
> -    return qobject_from_jsonv(string, NULL);
> +    return qobject_from_jsonf("%s", string);
>  }
>
>  /*
>

No, this returns string converted to a QString.  It doesn't return the 
result of parsing string as JSON.

If you want you can "fix" it by inlining qobject_from_jsonv into 
qobject_from_json.

Paolo

      reply	other threads:[~2014-03-05 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 21:02 [Qemu-devel] [PATCH] qjson.h: Remove GCC_FMT_ATTR markup from qobject_from_jsonv() declaration Stefan Weil
2014-03-05 21:11 ` Eric Blake
2014-03-05 22:47   ` Paolo Bonzini [this message]

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=5317A97B.4070108@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=eblake@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).