GNU bug report logs - #61730
30.0.50; Compiler warnings for delq and delete

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Thu, 23 Feb 2023 10:30:01 UTC

Severity: wishlist

Found in version 30.0.50

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Compiler warnings for delq and delete
Date: Thu, 23 Feb 2023 11:29:25 +0100
Hello,

I think we should add compiler warnings for `delete' and `delq' function
calls whose return values are unused.  Those are most likely unintended:
still some programmers don't know that the return value must be assigned
back because the destructive operation on the original list structure
does not necessarily lead to the return value.  It's a pitfall and can
lead to bugs that are hard to debug, so having warnings would be an
improvement.

I think the warnings could be added in a similar way as the "mapcar
called for effect" warnings work.

Adding the same kind of warning for `remq' and `remove' would probably
also be useful.  This will probably not occur that often but it still
would be useful I think.

TIA,

Michael.






This bug report was last modified 1 year and 286 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.