Subject: bug#43439: [PATCH] doprnt improvements

From: Eli Zaretskii <[email-masked]>
Date: Wed, 16 Sep 2020 17:58:24 +0300

> From: Paul Eggert <[email-masked]>
> Date: Tue, 15 Sep 2020 18:50:51 -0700
> Cc: Paul Eggert <[email-masked]>
> 
> (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.