From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24863: Functions declared as side-effect-free do not generate warnings in the same file Date: Sat, 06 Feb 2021 12:54:21 +0100 Message-ID: <87y2g1bedu.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21271"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 24863@debbugs.gnu.org To: Wilfred Hughes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 06 12:55:12 2021 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 1l8MBE-0005Q3-Id for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Feb 2021 12:55:12 +0100 Original-Received: from localhost ([::1]:45564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8MBD-00030l-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Feb 2021 06:55:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8MB4-00030A-Sk for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2021 06:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33771) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8MB4-0000Oo-LZ for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2021 06:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l8MB4-0000XS-IR for bug-gnu-emacs@gnu.org; Sat, 06 Feb 2021 06:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Feb 2021 11:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24863 X-GNU-PR-Package: emacs Original-Received: via spool by 24863-submit@debbugs.gnu.org id=B24863.16126124842020 (code B ref 24863); Sat, 06 Feb 2021 11:55:02 +0000 Original-Received: (at 24863) by debbugs.gnu.org; 6 Feb 2021 11:54:44 +0000 Original-Received: from localhost ([127.0.0.1]:45314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8MAh-0000WL-Lg for submit@debbugs.gnu.org; Sat, 06 Feb 2021 06:54:44 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:52036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8MAb-0000W1-VG for 24863@debbugs.gnu.org; Sat, 06 Feb 2021 06:54:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=TaLmOrSVCD0AyS3JJUzcVDL857seC9mHXUIH7yGslvY=; b=plW5pUzX6KpWo16T4iq+4k54sk 3F67w1OTi2ZSJ3pIWGQqYxJDmHc53a7MaDhVMqoJImXa8Qau0Mj0VBEiAGwJI9X17fZjlkSrYTKiE cFlITH88dIJnt1W+wPzd1CUp25Qh0K9Ajs87Dm5q0IGcQaEj1iwlY7zglclMbHoSFowk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l8MAQ-0005EO-JZ; Sat, 06 Feb 2021 12:54:27 +0100 X-Now-Playing: John Pashley's Phoenix New Orleans Jazz Band's _Shining Bright (The Songs of Lal & Mike Waterson)_: "Bright Phoebus" In-Reply-To: (Wilfred Hughes's message of "Wed, 2 Nov 2016 20:59:39 -0400") 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" Xref: news.gmane.io gmane.emacs.bugs:199425 Archived-At: Wilfred Hughes writes: > If I declare a function as side-effect-free, I do not get warnings > when I call it for side effects: > > (defun foo-pure (x) > (declare (side-effect-free t)) > x) > > (defun foo-calls-pure () > ;; No warning here: > (foo-pure 1) > 12) > > However, if I define foo-pure in a standalone file and byte-compile > it, I get byte-compile warnings when I define foo-calls-pure in a > second file. I tried this in Emacs 25.1-28, and I do get a warning: Compiling file /tmp/side.el at Sat Feb 6 12:51:52 2021 Entering directory =E2=80=98/tmp/=E2=80=99 In foo-calls-pure: side.el:5:8: Warning: value returned from (foo-pure 1) is unused You didn't specify what Emacs version you were reporting the bug for, but I'm going to go ahead and guess that this has been fixed since, and I'm closing this bug report. If the issue persists, please respond to the debbugs address and we'll reopen. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no