From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Newsgroups: gmane.emacs.bugs Subject: bug#33828: 26.1; Unbound defvar across compilation units Date: Fri, 21 Dec 2018 12:02:55 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545409273 9965 195.159.176.226 (21 Dec 2018 16:21:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2018 16:21:13 +0000 (UTC) Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= To: 33828@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 21 17:21:09 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 1gaNXx-0002UA-0j for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 17:21:09 +0100 Original-Received: from localhost ([::1]:46543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNa3-00028W-LJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Dec 2018 11:23:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaNZp-00027S-QM for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 11:23:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaNZo-00028i-Pd for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 11:23:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaNZo-00028V-KF for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 11:23:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gaNZm-00087F-Rd for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 11:23:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Lu=C3=ADs?= Oliveira Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Dec 2018 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33828 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.154540935431130 (code B ref -1); Fri, 21 Dec 2018 16:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Dec 2018 16:22:34 +0000 Original-Received: from localhost ([127.0.0.1]:58704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaNZK-000862-0L for submit@debbugs.gnu.org; Fri, 21 Dec 2018 11:22:34 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gaJWz-00072m-4i for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaJWr-0004tM-GL for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:47 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51373) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaJWr-0004t2-BG for submit@debbugs.gnu.org; Fri, 21 Dec 2018 07:03:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaJWq-0003nA-EO for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaJWm-0004oc-B4 for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:42 -0500 Original-Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]:37111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaJWk-0004gh-FA for bug-gnu-emacs@gnu.org; Fri, 21 Dec 2018 07:03:38 -0500 Original-Received: by mail-vs1-xe2d.google.com with SMTP id n13so3089055vsk.4 for ; Fri, 21 Dec 2018 04:03:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=leL4DO/LqazyAhTSBOISNStJCEgu9IaxpyWSTAplyP4=; b=t9mrzTa/3/UYz4/T7dyTSWnlN0fejDx+lfBoXujsaeMwY2ow0UWjVYJ2eULv1/f5ag vluympKwVdjHlCgnZ9c3aGS35JzF1XyvwEr2ca9ew5K008WZvi6ibq9xVyVEGYpyq1Ys RNbSBjYnyP/x+dvVdHC4xj6Dp9JvXWzgZoBEntSF/OYSFPGZQi/PYeqf9trTkwaJZ7Bs ENts+d7L33gobTHw1bitfYu1PuQCocDwt8MwhYI2vqnRMjInbMCPhq2gQsnjz4TuoHqA 19mIzPP+d65/QK9Q7asS3fd42hJmlY8x7UIxoAzWZqBWSFnLqSewdiuht6KxOCoZo+Zt SSvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=leL4DO/LqazyAhTSBOISNStJCEgu9IaxpyWSTAplyP4=; b=Qb6FFNSAfBhmHWtmm8C+Ex7fEpAlW7HpsnYUN/S68EQPqIBDJ0nN+N0OOD07qUfGR/ eV79LogSpEGL6HHMPb9gq5+Xvw2By3+uwbVKX1UEv5Sla6SaF+pBrTPbgoRX7kN/QPkw l5l1Hl0R24K+l0/bjCftkhDSJKGI2Gl+7hBwa4+sdv63RjhMxtGqlwnoK7TJYhZ7gojj VAe+fUC0Ogs7eRIzuM7wzWv+jlzJrnHxxfWcAAWM37l/GkDUR4GNR6qPoJUBLh+WQxJx Q2oRpvx4AY/gu9TidiNr8PDDBE7l/hkKqvJtkEhwbxiIvRdqKfTwb5/RqnoGHDLWVoq4 Wt5w== X-Gm-Message-State: AA+aEWY+btIC4HkihVAdao5IbFGGYc+2pQULkFFNueIg7QnrENZjADox DHXj7HfXT4rGLRgyA9tUs5eSePEYFS6YSnWyGtAS3Q== X-Google-Smtp-Source: AFSGD/VW6AH/KTcO0rUc5dNg0+Ceuc/0c17pFbAcfUO/XkbElYW4+5qdfw7gJLWAUY6bwnbitEZAxNGA7ehAGYBztL4= X-Received: by 2002:a05:6102:245:: with SMTP id a5mr906803vsq.162.1545393812097; Fri, 21 Dec 2018 04:03:32 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Fri, 21 Dec 2018 11:22:32 -0500 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:153688 Archived-At: Hello, I think I've come across a bug. $ cat f1.el ;;; f1.el --- -*- lexical-binding: t; -*- ;;; Lexical binding is set to T, but the bug happens regardless. (defvar my-special) (provide 'f1) $ cat f2.el ;;; f2.el --- -*- lexical-binding: t; -*- (require 'f1) (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' 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 Changing f1.el's defvar to have an initial value makes the problem go away, but this behaviour was unexpected to me. Moving defvar inside f2.el also fixes it. Cheers, Lu=C3=ADs