From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Review request: Fixing of spurious byte compiler warnings "might not be defined at runtime". Date: Sat, 21 Nov 2015 20:30:16 +0000 Message-ID: <20151121203016.GB3636@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1448137714 29131 80.91.229.3 (21 Nov 2015 20:28:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2015 20:28:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 21 21:28:25 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a0Elk-0004JU-SL for ged-emacs-devel@m.gmane.org; Sat, 21 Nov 2015 21:28:25 +0100 Original-Received: from localhost ([::1]:53567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Elk-0005N3-B1 for ged-emacs-devel@m.gmane.org; Sat, 21 Nov 2015 15:28:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Elg-0005L6-Kt for emacs-devel@gnu.org; Sat, 21 Nov 2015 15:28:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0Eld-0007Za-DZ for emacs-devel@gnu.org; Sat, 21 Nov 2015 15:28:20 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:32326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Eld-0007ZH-3Z for emacs-devel@gnu.org; Sat, 21 Nov 2015 15:28:17 -0500 Original-Received: (qmail 8365 invoked by uid 3782); 21 Nov 2015 20:28:15 -0000 Original-Received: from acm.muc.de (p5B1473B2.dip0.t-ipconnect.de [91.20.115.178]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 21 Nov 2015 21:28:14 +0100 Original-Received: (qmail 2617 invoked by uid 1000); 21 Nov 2015 20:30:16 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194964 Archived-At: 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).