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 #17 received at 61730 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>,
 61730 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#61730: 30.0.50; Compiler warnings for delq and delete
Date: Fri, 24 Feb 2023 16:11:51 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> > Thus such a warning definitely falls on the beneficial side. Let's do it.
>
> I'd hate to see Emacs's byte compiler becoming the Big Brother who
> knows better.  Richard described a couple of situations where the
> "problematic" usage is completely legitimate and safe

He mentioned only one: "when you know that the elements to be deleted
cannot include the first element", and that's the only one I know.  Are
there more?

Even that case is a burden to the reader and the maintainer, because one
has to think about and verify that this condition is fulfilled.  And IMO
this case is more dangerous than the `mapcar' case which just produces
slightly more inefficient code.

But yes, we would warn about some legitimate and safe calls.  The
advantages outweigh the disadvantages in my opinion.

> please try not to emit the warning in those cases.

I think this is impossible.  The compiler can't know or prove whether
the element to delete is different from the first one.


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.