Re: [Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-16 Thread Blue Swirl
On Sat, Oct 16, 2010 at 12:37 AM, Paolo Bonzini wrote: > On 10/15/2010 07:41 PM, Blue Swirl wrote: >> >> Which functions are optimized away and which aren't? > > It's builtins only that are optimized away or otherwise inlined (printf, > sprintf, etc.).  Other calls stay, together with side effects

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-16 Thread Paolo Bonzini
On 10/15/2010 07:41 PM, Blue Swirl wrote: Which functions are optimized away and which aren't? It's builtins only that are optimized away or otherwise inlined (printf, sprintf, etc.). Other calls stay, together with side effects and clock cycles. Paolo

Re: [Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-15 Thread Blue Swirl
On Fri, Oct 15, 2010 at 1:33 AM, Paolo Bonzini wrote: > 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 >>> main() { printf (""); } >>> >>>        .file   "" >>

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-14 Thread Paolo Bonzini
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 main() { printf (""); } .file "" .text .p2align 4,,15 .globl main .type main, @function main: .LFB11:

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-14 Thread Blue Swirl
On Thu, Oct 14, 2010 at 5:52 PM, Paolo Bonzini wrote: > On 10/14/2010 06:38 PM, Blue Swirl wrote: >> >> On Thu, Oct 14, 2010 at 9:20 AM, Markus Armbruster >>  wrote: >>> >>> Blue Swirl  writes: >>> On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster  wrote: > > Blue Swirl  writes:

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-14 Thread Paolo Bonzini
On 10/14/2010 06:38 PM, Blue Swirl wrote: On Thu, Oct 14, 2010 at 9:20 AM, Markus Armbruster wrote: Blue Swirl writes: On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster wrote: Blue Swirl writes: On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster wrote: Warns about this line in check

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-14 Thread Blue Swirl
On Thu, Oct 14, 2010 at 9:20 AM, Markus Armbruster wrote: > Blue Swirl writes: > >> On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster wrote: >>> Blue Swirl writes: >>> On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster wrote: > Warns about this line in check-qjson.c: >    

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-14 Thread Markus Armbruster
Blue Swirl writes: > On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster wrote: >> Blue Swirl writes: >> >>> On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster >>> wrote: Warns about this line in check-qjson.c:    QObject *obj = qobject_from_json(""); The obvious fix (add

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-13 Thread Blue Swirl
On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster wrote: > Blue Swirl writes: > >> On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster >> wrote: >>> Warns about this line in check-qjson.c: >>>    QObject *obj = qobject_from_json(""); >>> >>> The obvious fix (add -Wno-format-zero-length to gcc_

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-13 Thread Markus Armbruster
Blue Swirl writes: > On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster wrote: >> Warns about this line in check-qjson.c: >>    QObject *obj = qobject_from_json(""); >> >> The obvious fix (add -Wno-format-zero-length to gcc_flags) doesn't >> work, because -Wall switches it on again.  Fix by put

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-12 Thread Blue Swirl
On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster wrote: > Warns about this line in check-qjson.c: >    QObject *obj = qobject_from_json(""); > > The obvious fix (add -Wno-format-zero-length to gcc_flags) doesn't > work, because -Wall switches it on again.  Fix by putting configured > flags last

[Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string

2010-10-11 Thread Paolo Bonzini
On 10/11/2010 02:52 PM, Markus Armbruster wrote: Warns about this line in check-qjson.c: QObject *obj = qobject_from_json(""); The obvious fix (add -Wno-format-zero-length to gcc_flags) doesn't work, because -Wall switches it on again. Fix by putting configured flags last. Signed-off-by: