Received: from [140.186.70.92] (port=43416 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9LD2-0007Uc-9r for qemu-devel@nongnu.org; Fri, 22 Oct 2010 13:15:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9LD1-0007a5-19 for qemu-devel@nongnu.org; Fri, 22 Oct 2010 13:15:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9LD0-0007Zw-NJ for qemu-devel@nongnu.org; Fri, 22 Oct 2010 13:15:14 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 2/4] Silence compiler warning in json test case References: <1287756396-13100-1-git-send-email-lcapitulino@redhat.com> <1287756396-13100-3-git-send-email-lcapitulino@redhat.com> Date: Fri, 22 Oct 2010 19:15:07 +0200 In-Reply-To: <1287756396-13100-3-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Fri, 22 Oct 2010 12:06:34 -0200") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Jan Kiszka , Jan Kiszka , qemu-devel@nongnu.org Luiz Capitulino writes: > From: Jan Kiszka > > This avoids > > error: zero-length gnu_printf format string > > Signed-off-by: Jan Kiszka > Signed-off-by: Luiz Capitulino > --- > 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?