all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `declare-function' and compiler warnings.
@ 2011-11-28 19:59 Jay Belanger
  2011-11-28 20:13 ` Andreas Schwab
  2011-11-28 22:50 ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Jay Belanger @ 2011-11-28 19:59 UTC (permalink / raw)
  To: emacs-devel; +Cc: jay.p.belanger


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




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-29  1:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28 19:59 `declare-function' and compiler warnings Jay Belanger
2011-11-28 20:13 ` Andreas Schwab
2011-11-28 22:50 ` Glenn Morris
2011-11-29  1:07   ` Jay Belanger

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.