qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Jan Kiszka <jan.kiszka@web.de>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
Date: Fri, 22 Oct 2010 22:49:10 +0200	[thread overview]
Message-ID: <4CC1F8C6.3060803@mail.berlios.de> (raw)
In-Reply-To: <20101022153337.3a4c2ff3@doriath>

Am 22.10.2010 19:33, schrieb Luiz Capitulino:
> On Fri, 22 Oct 2010 19:15:07 +0200
> Markus Armbruster<armbru@redhat.com>  wrote:
>
>    
>> Luiz Capitulino<lcapitulino@redhat.com>  writes:
>>
>>      
>>> From: Jan Kiszka<jan.kiszka@web.de>
>>>
>>> This avoids
>>>
>>>      error: zero-length gnu_printf format string
>>>
>>> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
>>> Signed-off-by: Luiz Capitulino<lcapitulino@redhat.com>
>>> ---
>>>   check-qjson.c |    4 +++-
>>>   1 files changed, 3 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/check-qjson.c b/check-qjson.c
>>> index 0b60e45..64fcdcb 100644
>>> --- a/check-qjson.c
>>> +++ b/check-qjson.c
>>> @@ -639,7 +639,9 @@ END_TEST
>>>
>>>   START_TEST(empty_input)
>>>   {
>>> -    QObject *obj = qobject_from_json("");
>>> +    const char *empty = "";
>>> +
>>> +    QObject *obj = qobject_from_json(empty);
>>>       fail_unless(obj == NULL);
>>>   }
>>>   END_TEST
>>>        
>> The warning is silly.  Printing nothing is unlikely to happen
>> unintentionally, and is perfectly well-defined and portable.
>>
>> Why make the code ugly to avoid a useless warning, when we can disable
>> the warning?
>>      
> You mean, disable it only for this specific case or QEMU wide?
>
> If it's the former, please, submit a patch. Otherwise, this has been
> discussed already and the conclusion was that the warning is
> useful:
>
>   http://www.mail-archive.com/qemu-devel@nongnu.org/msg44072.html
>
> Honestly speaking, no matter what the conclusion is, what can not
> happen is having code that doesn't compile in the tree. Either: we apply
> this patch or revert the patch that broke the build.
>    


If needed, commit 8b7968f7c4ac8c07cad6a1a0891d38cf239a2839
can be reverted partially (only for qjson.h).

Tell me if you would prefer that solution, then I can send a patch.

  reply	other threads:[~2010-10-22 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-22 14:06 [Qemu-devel] [PULL 0/4]: Monitor queue Luiz Capitulino
2010-10-22 14:06 ` [Qemu-devel] [PATCH 1/4] Trivial fix for QMP/qmp-events.txt Luiz Capitulino
2010-10-22 14:06 ` [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case Luiz Capitulino
2010-10-22 17:15   ` Markus Armbruster
2010-10-22 17:33     ` Luiz Capitulino
2010-10-22 20:49       ` Stefan Weil [this message]
2010-10-25 12:12         ` Luiz Capitulino
2010-10-22 14:06 ` [Qemu-devel] [PATCH 3/4] Fix test suite build with tracing enabled Luiz Capitulino
2010-10-22 14:06 ` [Qemu-devel] [PATCH 4/4] monitor: Ignore "." and ".." when completing file name Luiz Capitulino

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=4CC1F8C6.3060803@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=armbru@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.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 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).