From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#33828: 26.1; Unbound defvar across compilation units Date: Fri, 21 Dec 2018 22:02:49 +0200 Message-ID: <83muoybqc6.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1545423047 6791 195.159.176.226 (21 Dec 2018 20:10:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2018 20:10:47 +0000 (UTC) Cc: joaotavora@gmail.com, 33828@debbugs.gnu.org To: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 21 21:10:43 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaR87-0001fl-3S for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 21:10:43 +0100 Original-Received: from localhost ([::1]:47660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaRAD-0006fb-OG for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 15:12:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaR6a-0004DT-Ak for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 15:09:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaR6W-00087D-4Z for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 15:09:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaR6U-00085Q-6s for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 15:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gaR6T-0007NO-V9 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 15:09: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, 21 Dec 2018 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 33828-submit@debbugs.gnu.org id=B33828.154542288828287 (code B ref 33828); Fri, 21 Dec 2018 20:09:01 +0000 Original-Received: (at 33828) by debbugs.gnu.org; 21 Dec 2018 20:08:08 +0000 Original-Received: from localhost ([127.0.0.1]:58815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaR5b-0007MB-P8 for submit@debbugs.gnu.org; Fri, 21 Dec 2018 15:08:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaR5a-0007Ls-Uy for 33828@debbugs.gnu.org; Fri, 21 Dec 2018 15:08:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaR5I-0006tk-DS for 33828@debbugs.gnu.org; Fri, 21 Dec 2018 15:07:54 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaR5A-0006dq-Dm; Fri, 21 Dec 2018 15:07:40 -0500 Original-Received: from [176.228.60.248] (port=2043 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gaR0h-0006uA-9k; Fri, 21 Dec 2018 15:04:52 -0500 In-reply-to: (message from =?UTF-8?Q?Lu=C3=ADs?= Oliveira on Fri, 21 Dec 2018 12:02:55 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:153696 Archived-At: > From: Luís Oliveira > Date: Fri, 21 Dec 2018 12:02:55 +0000 > Cc: João Távora > > I think I've come across a bug. Doesn't look like a bug to me. > (defun f2-foo () > (let ((my-special 123)) > (f2-bar))) > > (defun f2-bar () > my-special) > > (print (f2-bar)) > > > > $ emacs -Q -L . -f batch-byte-compile f2.el > > In toplevel form: > f2.el:5:1:Warning: Unused lexical variable `my-special' That's because you do nothing with the value of f2-bar. > In f2-bar: > f2.el:10:3:Warning: reference to free variable `my-special' > > > Also: > > $ emacs -Q -L . -batch -l f2.el > Symbol's value as variable is void: my-special You need to use defvar in the same file.