From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emagii.se (www.emagii.com [185.133.207.17]) by sourceware.org (Postfix) with ESMTPS id A382838582A3 for ; Wed, 15 Feb 2023 17:55:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A382838582A3 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=emagii.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emagii.com Received: from [10.175.196.145] (84-55-68-216.customers.ownit.se [84.55.68.216]) by emagii.se (Postfix) with ESMTPSA id 64499120009; Wed, 15 Feb 2023 18:55:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emagii.com; s=default; t=1676483727; bh=z06i5QviaA7SH2KXxOIiSWxeajWANkRCfFmDjrsgGg8=; h=Subject:To:From; b=WPJflDEidUkXxRBarwhhqYEQa3crbYxATaBChAAm1ZFZs/08LZE0jcGZi6gmv97km VwKsdX/ADYcPnSqjcG63ftNXmVZtyAy6btuVcitRo7MKe88a/jIlUIu2JORlfWqAPo 9dQclwmQPceSsOSnzug+7WFUzfyiw1v5Y58balXA= Authentication-Results: emagii.beebytevps.io; spf=pass (sender IP is 84.55.68.216) smtp.mailfrom=binutils@emagii.com smtp.helo=[10.175.196.145] Received-SPF: pass (emagii.beebytevps.io: connection is authenticated) Message-ID: <6ae85247-4274-fea7-78e3-fcf49a20fda1@emagii.com> Date: Wed, 15 Feb 2023 18:55:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [RFC v0 0/6] ASCII Command for output section Content-Language: sv-FI To: Nick Clifton , binutils@sourceware.org References: <20230215114052.28292-1-binutils@emagii.com> From: Ulf Samuelsson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <167648372765.3847508.4905118552670335628@localhost.localdomain> X-PPP-Vhost: emagii.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_FAIL,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Den 2023-02-15 kl. 18:07, skrev Nick Clifton: > Hi Ulf, > >> I would like to support >> >>     ASCII , >> >> when I try, and add >>         ASCII  32 , "mystring" >> >> I get a "syntax error", and would like to understand why. > > Whilst I have not gone into this too deeply, I think that the > short answer is "because that is the way that the linker's > parser works".  It expects numerical expressions, including > constant integer values, to be enclosed in parentheses. I did a small trick allowing me to turn on yydebug.     | DEBUG ON         {           yydebug = 1;         }     | DEBUG OFF         {           yydebug = 0;         } so I saw that it is parsed as 'ASCII', 'NAME' and not 'ASCII', 'INT' > >> If I do: >>     ASCII () >> I do not get a syntax error when I do >> >>     ASCII (32) "mystring" > > Since this method works, I would suggest just sticking with it. > If we are forced to do    ASCII (32) , "mystring" it is no advantage, so I guess I have to give up my original idea. > Also, whilst using sprintf() to process escape sequences is a > nice idea, it will not work.  Escape sequences are a C language > feature not a C library feature, so sprintf and its friends will > not translate them for you. > Yes, You are right. > Cheers >   Nick > > Best Regards Ulf Samuelsson