From: Paolo Bonzini <pbonzini@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string
Date: Fri, 15 Oct 2010 03:33:35 +0200 [thread overview]
Message-ID: <4CB7AF6F.4010104@redhat.com> (raw)
In-Reply-To: <AANLkTimRvyX74-tRYFrQB=JrJm+2yysrW_o6xn44tR4u@mail.gmail.com>
On 10/14/2010 07:59 PM, Blue Swirl wrote:
>> It is even more hypothetical when empty-format printfs are optimized away by
>> GCC:
>>
>> $ gcc -x c - -O2 -S -o -
>> #include<stdio.h>
>> main() { printf (""); }
>>
>> .file ""
>> .text
>> .p2align 4,,15
>> .globl main
>> .type main, @function
>> main:
>> .LFB11:
>> .cfi_startproc
>> rep
>> ret
>> .cfi_endproc
>>
>> and other attribute-printf-marked functions are probably not noop when the
>> format argument is empty.
>
> How is that? Does the warning message from qobject_from_json("") mean
> that GCC may optimize that call away?
I meant, the warning is likely bogus for most functions that do
"something like printf" but it is not printf (like qobject_from_json, or
asprintf). If the only good reason to have the warning is a
hypothetical performance degradation, let's please turn it off, because
this performance degradation isn't even there.
Paolo
next prev parent reply other threads:[~2010-10-15 1:33 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-11 12:52 [Qemu-devel] [PATCH] Suppress warning: zero-length gnu_printf format string Markus Armbruster
2010-10-11 13:09 ` [Qemu-devel] " Paolo Bonzini
2010-10-12 17:35 ` Blue Swirl
2010-10-13 7:19 ` Markus Armbruster
2010-10-13 18:57 ` Blue Swirl
2010-10-14 9:19 ` [Qemu-devel] [PATCH] configure: Support disabling warnings in $gcc_flags Markus Armbruster
2010-10-20 20:55 ` [Qemu-devel] " Blue Swirl
2010-10-14 9:20 ` [Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string Markus Armbruster
2010-10-14 16:38 ` Blue Swirl
2010-10-14 17:52 ` Paolo Bonzini
2010-10-14 17:59 ` Blue Swirl
2010-10-15 1:33 ` Paolo Bonzini [this message]
2010-10-15 17:41 ` Blue Swirl
2010-10-16 0:37 ` Paolo Bonzini
2010-10-16 16:28 ` Blue Swirl
2010-10-16 17:42 ` [Qemu-devel] [PATCH] Silence compiler warning in json test case Jan Kiszka
2010-10-18 14:14 ` 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=4CB7AF6F.4010104@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=blauwirbel@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.