From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61730: 30.0.50; Compiler warnings for delq and delete Date: Fri, 24 Feb 2023 15:56:22 +0200 Message-ID: <83a613np4p.fsf@gnu.org> References: <87ilfsisje.fsf@web.de> <670D8E4A-333D-4E2D-97CC-86728965989D@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32057"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael_heerdegen@web.de, 61730@debbugs.gnu.org, monnier@iro.umontreal.ca To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 14:57:11 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pVYZT-00087n-0R for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 14:57:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVYZO-0006w9-LT; Fri, 24 Feb 2023 08:57:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVYZL-0006sQ-EW for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 08:57:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVYZK-0003aR-3c for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 08:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVYZJ-0006iW-Ol for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 08:57:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Feb 2023 13:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61730 X-GNU-PR-Package: emacs Original-Received: via spool by 61730-submit@debbugs.gnu.org id=B61730.167724699225775 (code B ref 61730); Fri, 24 Feb 2023 13:57:01 +0000 Original-Received: (at 61730) by debbugs.gnu.org; 24 Feb 2023 13:56:32 +0000 Original-Received: from localhost ([127.0.0.1]:36354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVYYq-0006hf-1v for submit@debbugs.gnu.org; Fri, 24 Feb 2023 08:56:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVYYo-0006hS-Cl for 61730@debbugs.gnu.org; Fri, 24 Feb 2023 08:56:30 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVYYi-0002go-20; Fri, 24 Feb 2023 08:56:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ihYyILU5yFXggjTVpZbMQ9i5blIwRsKbJUQ+Jz/3Ptc=; b=EJTyLw9XjBIyN+NoSd89 WHUB9VwWQs/6FzQusKfw5CvIzj1P4HRD2r5BV6FDhd/UbD3WrmOWVfu+uEMJ/uldVICGUXUjFFIel L8DqEcgNA1NM33g4MUP1kJck7Et2M/890lpvrK2iTmikC/byk+PYZe9mPXJlplVlakLaxennqcb97 OPbgLf8SEUhctHFLiliBbrUjwK8p16T+I9laakaSTqmiResAiy3V8wTravQV6bEzZkv5YLVOeWPRK 1t+wV2ry+7a/82O29zVIGdaZ4Lo1AhzbEtx0MMVQBfpd2Ank7n0dilFXYaI+ANBVWWZbt0604Zl6U lPKJviCMUcG5VQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVYYg-0004R4-NJ; Fri, 24 Feb 2023 08:56:23 -0500 In-Reply-To: <670D8E4A-333D-4E2D-97CC-86728965989D@gmail.com> (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Fri, 24 Feb 2023 14:43:34 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256600 Archived-At: > Cc: 61730@debbugs.gnu.org, Stefan Monnier > From: Mattias EngdegÄrd > Date: Fri, 24 Feb 2023 14:43:34 +0100 > > Let's experiment: warning about for-effect calls to > > mapcar mapcan mapconcat > delq delete delete-dups delete-consecutive-dups > cl-delete cl-delete-if cl-delete-if-not cl-delete-duplicates > sort > > results in 34 such calls found on master, most of them about `delq` and `delete`, but `delete-dups`, `cl-delete`, `mapconcat` and `sort` are also represented. > > Some of these are no doubt safe, a few of them knowingly so, but it's definitely not obvious from a quick look at the code. It's poor style in any case. > > 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; please try not to emit the warning in those cases.