From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adpgY-00085f-If for qemu-devel@nongnu.org; Wed, 09 Mar 2016 20:46:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adpgX-0008Kp-PT for qemu-devel@nongnu.org; Wed, 09 Mar 2016 20:46:42 -0500 Date: Thu, 10 Mar 2016 09:46:25 +0800 From: Peter Xu Message-ID: <20160310014625.GE4091@pxdev.xzpeter.org> References: <1457502997-30904-1-git-send-email-peterx@redhat.com> <1457502997-30904-2-git-send-email-peterx@redhat.com> <56E0A02B.50102@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56E0A02B.50102@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, armbru@redhat.com 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