From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jay Belanger Newsgroups: gmane.emacs.devel Subject: `declare-function' and compiler warnings. Date: Mon, 28 Nov 2011 13:59:36 -0600 Message-ID: <87k46k587r.fsf@vh213601.truman.edu> Reply-To: jay.p.belanger@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322510337 9576 80.91.229.12 (28 Nov 2011 19:58:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2011 19:58:57 +0000 (UTC) Cc: jay.p.belanger@gmail.com To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 20:58:52 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RV7Ll-0006c7-6R for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2011 20:58:49 +0100 Original-Received: from localhost ([::1]:50134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7Lk-0006t0-E5 for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2011 14:58:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7Lh-0006sv-HP for emacs-devel@gnu.org; Mon, 28 Nov 2011 14:58:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV7Lf-0001v2-57 for emacs-devel@gnu.org; Mon, 28 Nov 2011 14:58:45 -0500 Original-Received: from mail.truman.edu ([150.243.162.204]:39756 helo=uranium.truman.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7Lf-0001uu-1s for emacs-devel@gnu.org; Mon, 28 Nov 2011 14:58:43 -0500 Original-Received: from vh213601.truman.edu (vh213601.truman.edu [150.243.162.59]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by uranium.truman.edu (Postfix) with ESMTPS id 61E02128361; Mon, 28 Nov 2011 13:58:41 -0600 (CST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 150.243.162.204 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:146320 Archived-At: I recently noticed that compiling `calc.el' results in a compiler warning: "the function `math-zerop' is not known to be defined". (I can fix that when I get to my home computer.) The function `math-zerop' is not explicitly used in calc.el, but it does appear in the bytecode since it is part of the definition of the inline function `Math-zerop' which is used in calc.el. Is there supposed to be a compiler warning in this case? It turns out that `math-zerop' is used explicitly in other files with no declaration and no compiler warning (because it is autoloaded, perhaps). Finally, there is no declaration for `Math-zerop' in calc.el and no warning, either. In the elisp info file, "Declaring Functions", it mentions explicitly how to handle functions defined with `defstruct' (as `Math-zerop' is), so I would expect a declaration would be necessary. Should it be? I am probably missing some subtleties of when declaring functions is necessary; I'll be happy just declaring them when I see compiler warnings. Jay