[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats liter
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal |
Date: |
Thu, 10 Mar 2016 09:46:25 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Wed, Mar 09, 2016 at 03:14:03PM -0700, Eric Blake wrote:
> > + func_fprintf(f, "%*s[%i]:%c", indentation * 4, "", i,
> > + composite ? '\n' : ' ');
>
> [The nerd in me wants to point out that you could avoid the ternary by
> writing '"\n "[composite]', but that's too ugly to use outside of IOCCC
> submissions, and I wouldn't be surprised if it (rightfully) triggers
> clang warnings]
Do you mean something like:
int i = 0;
printf("%c", '"\n "[i]');
Is this a grammar btw?
Peter
[Qemu-devel] [PATCH 2/2] block/qapi: fix unbounded stack for dump_qdict, Peter Xu, 2016/03/09
Re: [Qemu-devel] [PATCH 0/2] block/qapi: trivial fixes, Markus Armbruster, 2016/03/22