qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]