GNU bug report logs -
#21963
Spurious byte compile message: "Warning: the function `bar' might not be defined at runtime."
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Fri, 20 Nov 2015 10:50:03 UTC
Severity: minor
Fixed in version 25.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 21963 <at> debbugs.gnu.org (full text, mbox):
Hello, Eli.
On Fri, Nov 20, 2015 at 01:19:19PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 20 Nov 2015 10:44:19 +0000
> > From: Alan Mackenzie <acm <at> muc.de>
> > This bug is a variant of bug #11918, which hasn't yet been resolved.
> I'm not sure this is the same issue.
Possibly not.
> > 1. Create two Emacs Lisp source files, ~/warnings-bar.el and
> > ~/warnings-foo.el with the following contents:
> > ;;;;;;;; warnings-bar.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > (defun bar ()
> > "Doc string"
> > "bar")
> > (provide 'warning-bar)
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > ;;;;;;;; warnings-foo.el ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > (eval-when-compile (require 'warning-bar))
> > (require 'warning-bar)
> > (defun foo ()
> > (bar))
> > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > 2. (Optional) byte compile warnings-bar.el.
> > 3. Byte compile warnings-foo.el with:
> > emacs -Q -batch -L ~ -f batch-byte-compile warning-foo.el
> > . This produces the spurious warning message:
> > warning-foo.el:6:1:Warning: the function `bar' might not be defined
> > at runtime.
> > .
> eval-when-compile has no effect at run time, and the warning is
> explicitly about what might happen at runtime.
> IOW, I don't think this is a bug.
It is, at the very least, puzzling behaviour. The warning is issued for
a function that most definitely has been defined at runtime.
What seems to be happening (I'm speculating a little) is that the byte
compiler maintains a list of not-yet-defined functions in
byte-compile-unresolved-functions. Functions defined at compile time
are pushed onto this list. The problem is that when they are later
defined for run time, they aren't taken off the list.
Given that we've all been asked to get rid of warnings for 25.1, I have
to disagree with you about whether this is a bug.
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 5 years and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.