From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 2CBED3858D35 for ; Mon, 13 Feb 2023 10:32:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CBED3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x633.google.com with SMTP id e17so4186797plg.12 for ; Mon, 13 Feb 2023 02:32:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0ddqV6E+jC+Pge4qAjsml/l1nOZtdH8UkhWETPKc7fs=; b=GApZKXUA8AnCGNpJYLItyhnK6rxODGp1WJKR4Jm+v43HAf/dtSVlEKI/DB3SoDkpc9 CNL2ibUhs3lbdIlP+2c2e4o836XN7gHF6Xy7gZEAvg4V7nMoXNPFqcYYngjJUdBSJ0MT Ol05MUQPrCVGHsjhp17lPjKEJjvp9fRTWXO99Iy3KyKzQVQxQmMvuzsCNkqAMhhrEKpD PV/ek9rD8Cc7s1Me4eZU1N2MoXZz3vfsMAQqKawGrtG6utAeZp13Y3gfclZzmMCrdSVy d9T03UznUxjnYeUmhIXg4TQb0/RmVw6JlMDRxBu/+F8ATYewzLg1ODOe85faoglZtvOO hHwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0ddqV6E+jC+Pge4qAjsml/l1nOZtdH8UkhWETPKc7fs=; b=PhqGcbm7yvUQYbsbFK4sh+86BWR/XvchmVSAc/NMPdraWKVxRTwAJlblAc8pBl4ZuX ANqmwUjYvHYx9UCybjYsl+39CeJQd8mybkOOEkeHYUw0HNIYGbWjp0ZCbv+7BfKJON22 uObqHHHelYA27dN2xjHSQ76VDhiTd2o93D3lPp8Hx/mZ8q7/wNdxx77aQu5vzKZRISkO x2US41uQLbjJ23fIn09cwLe0wfUxI546vISROXtA0RsCutTVs6XrlCcoG8LDAJZYM512 Vpcs41x9EQSheh3MCHL36d75uQDf8OJji2R4pDt/o0ZkSvfgNNoc1rejiQzcZL1vlhD1 QzJw== X-Gm-Message-State: AO0yUKXw7VzdO/I6KapQQCae2E8uecTPthbODYlQInkSjlmew7uv+S9b Ay3XD0QLRE5p499f1ffcFMQ4eVClz7Q= X-Google-Smtp-Source: AK7set/TKAAkPRJO7nWoxhDQZ+azs7zQCKrClnhzDqKFWzIX0+l3jw435qS26CVIdd/FvipORMxNXA== X-Received: by 2002:a17:903:12d7:b0:198:adc4:22a4 with SMTP id io23-20020a17090312d700b00198adc422a4mr15070118plb.31.1676284322590; Mon, 13 Feb 2023 02:32:02 -0800 (PST) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:8dde:3ec7:89e7:261d]) by smtp.gmail.com with ESMTPSA id e20-20020a170902ed9400b0019a6e9ae01csm6198680plj.21.2023.02.13.02.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 02:32:02 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id C6F561141174; Mon, 13 Feb 2023 21:01:59 +1030 (ACDT) Date: Mon, 13 Feb 2023 21:01:59 +1030 From: Alan Modra To: Jan Beulich Cc: Binutils Subject: Re: [PATCH] gas: improve interaction between read_a_source_file() and s_linefile() Message-ID: References: <08d262e3-c736-85ff-c45e-db96e55cff4c@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <08d262e3-c736-85ff-c45e-db96e55cff4c@suse.com> X-Spam-Status: No, score=-3027.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: On Mon, Feb 13, 2023 at 09:15:36AM +0100, Jan Beulich wrote: > read_a_source_file() would bump line numbers only when seeing a newline, > whereas is_end_of_line[] indicates further end-of-line characters, in > particular the nul character. s_linefile() attempts to compensate for > the bump, but was too aggressive with this so far: It should only adjust > when a newline ends the line. To facilitate such a check, the check for > nothing else on the line needs to move ahead, which luckily is easily > possible: The relevant two conditions match, and the function can > simply return from the body of that earlier instance of the conditional. > > The more strict treatment in s_linefile() then requires an adjustment > to buffer_and_nest()'s invocation of the function: The line terminator > now needs to be a newline, not nul. Looks good to me, thanks for sorting this out. -- Alan Modra Australia Development Lab, IBM