From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#15122: 24.3.50; [PATCH] byte-compiler warnings about destructive functions Date: Sun, 18 Aug 2013 22:59:51 -0400 Message-ID: References: <9ee2e7bb-6036-4e81-bb44-86d4ac74e7b8@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376881219 26555 80.91.229.3 (19 Aug 2013 03:00:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2013 03:00:19 +0000 (UTC) Cc: 15122@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 19 05:00:21 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VBFhb-0000AR-TT for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Aug 2013 05:00:20 +0200 Original-Received: from localhost ([::1]:40655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFhb-0003kx-En for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Aug 2013 23:00:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFhT-0003kS-A4 for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2013 23:00:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBFhN-0001PI-6I for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2013 23:00:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBFhN-0001Op-3r for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2013 23:00:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VBFhL-0008FQ-O8 for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2013 23:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Aug 2013 03:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15122-submit@debbugs.gnu.org id=B15122.137688119631653 (code B ref 15122); Mon, 19 Aug 2013 03:00:03 +0000 Original-Received: (at 15122) by debbugs.gnu.org; 19 Aug 2013 02:59:56 +0000 Original-Received: from localhost ([127.0.0.1]:39396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBFhE-0008ET-0B for submit@debbugs.gnu.org; Sun, 18 Aug 2013 22:59:56 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:47487) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VBFhB-0008ED-MW for 15122@debbugs.gnu.org; Sun, 18 Aug 2013 22:59:54 -0400 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r7J2xq31032290; Sun, 18 Aug 2013 22:59:52 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C0E9DAE0CA; Sun, 18 Aug 2013 22:59:51 -0400 (EDT) In-Reply-To: <9ee2e7bb-6036-4e81-bb44-86d4ac74e7b8@default> (Drew Adams's message of "Sat, 17 Aug 2013 22:26:16 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4674=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4674> : streams <1022147> : uri <1510783> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77489 Archived-At: > This StackOverflow entry suggested that the Emacs-Lisp byte compiler be > able to warn about the use of functions that are destructive, i.e., can > modify data structures in place: > http://stackoverflow.com/questions/17610046/elisp-destructive-operation-warning > Attached is a patch that provides this, at least a start. All of those functions are used on a regular basis in perfectly correct code. So just flagging every call is not going to fly. We need to have some further analysis so that we don't flag all calls, but only those that "could be dangerous". As it stands, your code would just flood you with false positives, so it wouldn't really help you find the problematic uses. Stefan