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 17:29:23 +0200 Message-ID: <831qmfnkto.fsf@gnu.org> References: <87ilfsisje.fsf@web.de> <670D8E4A-333D-4E2D-97CC-86728965989D@gmail.com> <83a613np4p.fsf@gnu.org> <87fsavf688.fsf@web.de> 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="29161"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mattias.engdegard@gmail.com, 61730@debbugs.gnu.org, monnier@iro.umontreal.ca To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 24 16:30:26 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 1pVa1i-0007Qb-8m for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Feb 2023 16:30:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVa1N-0000TJ-IJ; Fri, 24 Feb 2023 10:30:05 -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 1pVa1L-0000T1-Rd for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 10:30:03 -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 1pVa1L-00027v-7T for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 10:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVa1K-0001AZ-H3 for bug-gnu-emacs@gnu.org; Fri, 24 Feb 2023 10:30:02 -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 15:30:02 +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.16772525714433 (code B ref 61730); Fri, 24 Feb 2023 15:30:02 +0000 Original-Received: (at 61730) by debbugs.gnu.org; 24 Feb 2023 15:29:31 +0000 Original-Received: from localhost ([127.0.0.1]:37943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVa0p-00019P-3w for submit@debbugs.gnu.org; Fri, 24 Feb 2023 10:29:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVa0n-00019C-LL for 61730@debbugs.gnu.org; Fri, 24 Feb 2023 10:29: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 1pVa0h-00022m-Aj; Fri, 24 Feb 2023 10:29:23 -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=bXfvaR2C1HsQqfNcGYnnn9DfKKLkw0PPbUMsgrRM+HY=; b=amPIVir+2YxU93/D1zMJ u2xq2ib6tmjnlqyAiqjvVCRBzFxYE3qx1HgqY1rrH+fyarK4HgQ8gRTeKfxReBwLoOfW0GF0lJXmX venm7UzhMR+W+IjZdiUZwLr7hzyUk3Ci6vfDBDY+7ha8ZkRIGO67pYkv0sSv9krO+OxAwAsEOFUBD W3KaWHenYJ0G2BriXyujNe75fmKa0qwSp0Om6CnAmBNJGqZBWsis7cAXZcucMwrh7EZ+d2N5ZWxsS ZQueLldLCHgY7tUPSnOe6Awu1wY7bqPvVvwRceQe1UkEh3iu4V79wMCueDp26z4b9Oru9AWGcXz8p F1+z5KjA3CNi/Q==; 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 1pVa0g-0007yH-Pk; Fri, 24 Feb 2023 10:29:23 -0500 In-Reply-To: <87fsavf688.fsf@web.de> (message from Michael Heerdegen on Fri, 24 Feb 2023 16:11:51 +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:256617 Archived-At: > From: Michael Heerdegen > Cc: Mattias EngdegÄrd , > 61730@debbugs.gnu.org, > monnier@iro.umontreal.ca > Date: Fri, 24 Feb 2023 16:11:51 +0100 > > But yes, we would warn about some legitimate and safe calls. The > advantages outweigh the disadvantages in my opinion. Not in my opinion. I'm sick and tired from seeing compilers emitting bogus warnings which require one to spend time verifying perfectly correct code, or, worse, modify the code to shut up the compiler. Do we really want to see stuff like (setq _ (delq ...)) in our code? > > 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. If it's really impossible (and I'm not sure it is), then the better course of action is to emit the warnings only if the byte compiler was requested to be more sensitive to potential issues, similar to GCC's "-W*" options. IOW, if someone wants to lint their code, let them ask for a linting compilation.