From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43439: [PATCH] doprnt improvements Date: Wed, 16 Sep 2020 17:58:24 +0300 Message-ID: <83o8m57oq7.fsf@gnu.org> References: <20200916015051.20517-1-eggert@cs.ucla.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11448"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43439@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 16 16:59:17 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIYtw-0002qP-Pd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Sep 2020 16:59:16 +0200 Original-Received: from localhost ([::1]:49916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIYtu-0005i0-RL for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Sep 2020 10:59:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIYth-0005fa-VZ for bug-gnu-emacs@gnu.org; Wed, 16 Sep 2020 10:59:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIYth-0001Pw-Ls for bug-gnu-emacs@gnu.org; Wed, 16 Sep 2020 10:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIYth-00019B-Lu for bug-gnu-emacs@gnu.org; Wed, 16 Sep 2020 10:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Sep 2020 14:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43439 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 43439-submit@debbugs.gnu.org id=B43439.16002683044359 (code B ref 43439); Wed, 16 Sep 2020 14:59:01 +0000 Original-Received: (at 43439) by debbugs.gnu.org; 16 Sep 2020 14:58:24 +0000 Original-Received: from localhost ([127.0.0.1]:35683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIYt5-00018F-T3 for submit@debbugs.gnu.org; Wed, 16 Sep 2020 10:58:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46756) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIYt3-000182-HA for 43439@debbugs.gnu.org; Wed, 16 Sep 2020 10:58:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42128) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIYsx-0001My-Ao; Wed, 16 Sep 2020 10:58:15 -0400 Original-Received: from [176.228.60.248] (port=3459 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kIYsw-00007u-EC; Wed, 16 Sep 2020 10:58:14 -0400 In-Reply-To: <20200916015051.20517-1-eggert@cs.ucla.edu> (message from Paul Eggert on Tue, 15 Sep 2020 18:50:51 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188170 Archived-At: > From: Paul Eggert > Date: Tue, 15 Sep 2020 18:50:51 -0700 > Cc: Paul Eggert > > (doprnt): Omit FORMAT_END argument, since it’s always NULL, > which means doprnt must call strlen on FORMAT; doing this means > doprnt needs just one pass over FORMAT, not two. All callers changed. This loses a feature. Emacs traditionally supports strings with embedded null characters, and this feature is in line with that. It is true that it is currently unused, but why is it a good idea to remove it? If the problem is the slight inefficiency caused by the call to strlen, we could instead solve it in the callers: all the formats I've seen are const strings, so the value of FORMAT_END can be computed at compile time, and used instead of passing NULL. > Drop support for > "%S" which is never used and which would cause GCC to warn anyway. This is an old compatibility feature, I'd rather not drop it. Who knows what code relies on the fact that 'message' and 'format-message' support it? Thanks.