emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

`declare-function' and compiler warnings.


From: Jay Belanger
Subject: `declare-function' and compiler warnings.
Date: Mon, 28 Nov 2011 13:59:36 -0600

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]