unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Checking before removing obsolete comment about memmove.
Date: Sun, 28 Nov 2021 02:23:11 -0600	[thread overview]
Message-ID: <87h7bwpu34.fsf@red-bean.com> (raw)

In src/editfns.c, in Ftranspose_regions, I'd like to remove this 
obsolete comment:

  /* Working without memmove, for portability (sigh), so must be 
     careful of overlapping subsections of the array...  */ 

We now use memmove() in that function since [1], just as we now 
use memmove() in many other places in Emacs.

(These days memmove() is assumed because C89 is assumed.  This 
wasn't always the case.  Searching backward for "memmove" from the 
bottom of src/ChangeLog.4 appears to show some temporary confusion 
at the time about whether memmove() was allowed, and if so how it 
would be provided; fortunately, that's all settled now.)

The reason I'm posting to ask before removing that comment is that 
I'm not sure if we have an anti-churn policy against making 
commits that just fix comments.  My preference is to fix it now, 
and not wait until the next time the actual code of 
Ftranspose_regions() needs to be changed, because it's an outright 
inaccuracy that might confuse the next reader.  But if we've 
already decided to leave such things be until the next time 
someone is actually working in the code, that's fine and I'll 
abide by it (and would be happy to document it in CONTRIBUTE if 
people would like that).

Best regards,
-Karl

[1] Namely, since this commit:

  commit 354f9f0fc6cc05ed98883447f9b2f37943d79160
  Author:     Fredrik Bergroth <fbergroth@gmail.com>
  AuthorDate: Tue Feb 23 22:41:16 2016 +1100
  Commit:     Lars Ingebrigtsen <larsi@gnus.org>
  CommitDate: Wed Feb 24 11:58:50 2016 +1100
  
      Use memmove instead of memcpy on overlapping regions
      
      * src/editfns.c (Ftranspose_regions): Regions may overlap, 
      so
      use memmove instead of memcpy (bug#19213).




             reply	other threads:[~2021-11-28  8:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-28  8:23 Karl Fogel [this message]
2021-11-28  8:46 ` Checking before removing obsolete comment about memmove Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7bwpu34.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).