[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case
From: |
Luiz Capitulino |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case |
Date: |
Fri, 22 Oct 2010 15:33:37 -0200 |
On Fri, 22 Oct 2010 19:15:07 +0200
Markus Armbruster <address@hidden> wrote:
> Luiz Capitulino <address@hidden> writes:
>
> > From: Jan Kiszka <address@hidden>
> >
> > This avoids
> >
> > error: zero-length gnu_printf format string
> >
> > Signed-off-by: Jan Kiszka <address@hidden>
> > Signed-off-by: Luiz Capitulino <address@hidden>
> > ---
> > 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/address@hidden/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.
[Qemu-devel] [PATCH 3/4] Fix test suite build with tracing enabled, Luiz Capitulino, 2010/10/22
[Qemu-devel] [PATCH 4/4] monitor: Ignore "." and ".." when completing file name., Luiz Capitulino, 2010/10/22