From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta013.uswest2.a.cloudfilter.net (omta013.uswest2.a.cloudfilter.net [35.164.127.236]) by sourceware.org (Postfix) with ESMTPS id 90B493857C48 for ; Wed, 2 Sep 2020 18:25:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 90B493857C48 Received: from cxr.smtp.a.cloudfilter.net ([10.0.16.209]) by cmsmtp with ESMTP id DMRWkmaQlEgURDXRpkcN5v; Wed, 02 Sep 2020 18:25:29 +0000 Received: from thunder.sweets ([68.100.138.62]) by cmsmtp with ESMTPSA id DXRmkTyDyl6uHDXRoklUed; Wed, 02 Sep 2020 18:25:29 +0000 X-Authority-Analysis: v=2.4 cv=B9AHbMhM c=1 sm=1 tr=0 ts=5f4fe399 a=3mkzfl4ircflX6G+lDqBYw==:117 a=3mkzfl4ircflX6G+lDqBYw==:17 a=20KFwNOVAAAA:8 a=IkcTkHD0fZMA:10 a=ZConlZuNEE8A:10 a=reM5J-MqmosA:10 a=XXB7eEQrXNfuv4D3gb8A:9 a=QEXdDO2ut3YA:10 Received: by thunder.sweets (Postfix, from userid 116) id 83C4311ABE; Wed, 2 Sep 2020 14:25:24 -0400 (EDT) Received: from [10.10.10.15] (thunder.sweets [10.10.10.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thunder.sweets (Postfix) with ESMTPS id 96EBB11AB5; Wed, 2 Sep 2020 14:25:23 -0400 (EDT) Message-ID: <5F4FE390.4000404@cox.net> Date: Wed, 02 Sep 2020 14:25:20 -0400 From: Joe Buehler User-Agent: Thunderbird 1.5.0.12 (X11/20120201) MIME-Version: 1.0 To: Andrew Haley CC: gcc-help@gcc.gnu.org Subject: Re: aph@redhat.com References: <5F48246C.6040402@cox.net> <8dff32c6-4e2c-2a1a-4216-98951f52b552@redhat.com> In-Reply-To: <8dff32c6-4e2c-2a1a-4216-98951f52b552@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfBdFbjl40xhQAqDE5jyuVFNoslgy+uSBVJ5pPDoq2wRlhWUBAcjfLEAjOM5Vipuu5Ma4uaFfms9uxACk6hFyc+fNCgwPJZ5yRZzZJMyE5c46HHz7iD2i I6WoLTCoz8QynGJ/kPm1+SwsTlBfVFkxz3fL2La8GJEZ6v4BG9N3ym5FJVimg6HqeFHlUaB71wuzUazNwEs1g9/gFY2RUupUxXs= X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Sep 2020 18:25:31 -0000 Andrew Haley wrote: > On 27/08/2020 22:23, Joe Buehler via Gcc-help wrote: > > temp.c: In function main : > temp.c:4:2: warning: asm operand 0 probably doesn t match constraints > __asm__ volatile(".8byte %0\n\t" : : "i" ("message %s\n")); > ^~~~~~~ > temp.c:4:2: error: impossible constraint in asm > > I'd use the "S" constraint. Thanks that worked. > >> I am unable to code something similar manually using inline asm because >> the string is a format string containing % characters, which inline asm >> will of course try to interpret. (Does gcc provide anything to escape % >> chars in a literal string?) > > "%%" > The problem is that I have literal printf format strings in a multiplatform code base. I need something like a gcc builtin to do the % doubling. #define X(fmt) asm ("lines " __builtin_escape(fmt) " more lines") Joe Buehler