GNU bug report logs - #18971
25.0.50; incorrect warning from byte compiler

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Thu, 6 Nov 2014 04:16:02 UTC

Severity: minor

Tags: wontfix

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Tom Tromey <tom <at> tromey.com>
Cc: 18971 <at> debbugs.gnu.org
Subject: bug#18971: 25.0.50; incorrect warning from byte compiler
Date: Thu, 06 Nov 2014 18:27:10 -0500
> I want to be able to call byte-optimize-form and was under the
> impression that byte-compile-close-variables was needed.  I'm doing this
> for a project I'm working on where it is convenient to let the byte
> compiler code macroexpand a form and do some simple optimizations on it.

Just curious: why do you need those simple optimizations performed by
byte-optimize-form?

> I guess I don't understand why this would not be a bug, though.
> Or at least it perplexes me why this happens; my only theory is that
> somehow the defvars aren't seen when byte-compiling my file.  I suppose
> if I wanted to export a macro like this, I would need it to come with
> special declarations for the variables?  Except I didn't see a way to do
> that either.

Those vars are not globally bound, i.e. they are only declared with
(defvar <var>) and this only affects the file in which they appear (or
even the scope, in case they appear within a defun body).

So the macro would need to expand to something like

   (progn
     (defvar byte-compile-free-assignments)
     ...
     (defvar byte-compile-free-references)
     (let (...) ...))

if it was meant to be used outside of bytecomp.el.


        Stefan




This bug report was last modified 5 years and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.