all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: emacs-devel@gnu.org
Subject: Review request: Fixing of spurious byte compiler warnings "might not be defined at runtime".
Date: Sat, 21 Nov 2015 20:30:16 +0000	[thread overview]
Message-ID: <20151121203016.GB3636@acm.fritz.box> (raw)

Hello, Emacs.

I've just created a branch fix/not-defined-at-runtime and committed a
fix into it.  This is a fix for bug #21963, and more.

The bug was the spurious generation by the byte compiler of warnings
like "function `foo' might not be defined at run time".

There were several problems here:
(i) The main one was, when defining new functions in an
`eval-when-compile' all these functions were blacklisted as "not at
runtime", even when they were subsequently defined in runtime scope.

(ii) In an `eval-when-compile', the byte compiler first compiles, then
evals the body.  It fails to isolate the main compilation from this
subsidiary compilation, leading to ".. not be defined at run time".

(iii) In interactive byte-compile-files, the variable
byte-compile-noruntime-functions was not being initialised between
runs, so that "blacklisted" functions accumulated in it.


The solution to (i) is to maintain a list of functions defined in
runtime scope, and when emitting warnings, to check the dodgy function
is not on the list before emitting a warning about it.

The solution to (ii) is to bind certain status variables to themselves
around the subsidiary compilation.


Some intractible warnings now no longer occur while building CC Mode,
for example.  Also, `format-spec' in org.el is no longer complained of.
It Would Be Nice If people could try out or review this new code.

-- 
Alan Mackenzie (Nuremberg, Germany).



             reply	other threads:[~2015-11-21 20:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 20:30 Alan Mackenzie [this message]
2015-11-22 12:54 ` Review request: Fixing of spurious byte compiler warnings "might not be defined at runtime" Artur Malabarba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151121203016.GB3636@acm.fritz.box \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.