GNU bug report logs - #21963
Spurious byte compile message: "Warning: the function `bar' might not be defined at runtime."

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 21963 <at> debbugs.gnu.org
Subject: bug#21963: Spurious byte compile message: "Warning: the function `bar' might not be defined at runtime."
Date: Fri, 20 Nov 2015 15:26:38 +0000
Hello, Eli.

On Fri, Nov 20, 2015 at 04:48:13PM +0200, Eli Zaretskii wrote:
> > Date: Fri, 20 Nov 2015 11:40:50 +0000
> > Cc: 21963 <at> debbugs.gnu.org
> > From: Alan Mackenzie <acm <at> muc.de>

> > > 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.

> No, it was not (or, more accurately, will not be).  'eval-when-compile'
> does nothing to make sure it will be defined at runtime; you need
> either 'require' or 'eval-and-compile'.

The first two lines of the file are:

   (eval-when-compile (require 'warning-bar))
   (require 'warning-bar)
 
The second line will define the function `bar' at run time.

The byte-compiler has already decided after the first line that `bar' is
not defined at run time (fair enough), but seems unwilling to change its
mind after the second line.

This isn't just an academic problem.  CC Mode uses such sequences (in
effect), producing warnings in the Emacs build.

-- 
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.