unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Checking before removing obsolete comment about memmove.
@ 2021-11-28  8:23 Karl Fogel
  2021-11-28  8:46 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Fogel @ 2021-11-28  8:23 UTC (permalink / raw)
  To: Emacs Devel

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).




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Checking before removing obsolete comment about memmove.
  2021-11-28  8:23 Checking before removing obsolete comment about memmove Karl Fogel
@ 2021-11-28  8:46 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2021-11-28  8:46 UTC (permalink / raw)
  To: Karl Fogel; +Cc: emacs-devel

> From: Karl Fogel <kfogel@red-bean.com>
> Date: Sun, 28 Nov 2021 02:23:11 -0600
> 
> 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.

Feel free to do that (on the emacs-28 branch, please).



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-28  8:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28  8:23 Checking before removing obsolete comment about memmove Karl Fogel
2021-11-28  8:46 ` Eli Zaretskii

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).