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

* Re: `declare-function' and compiler warnings.
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2011-11-28 20:13 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: emacs-devel

Jay Belanger <jay.p.belanger@gmail.com> writes:

> I recently noticed that compiling `calc.el' results in a compiler
> warning: "the function `math-zerop' is not known to be defined".

Doesn't happen for me.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



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

* Re: `declare-function' and compiler warnings.
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2011-11-28 22:50 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: emacs-devel

Jay Belanger wrote:

> I recently noticed that compiling `calc.el' results in a compiler
> warning: "the function `math-zerop' is not known to be defined".

I also can't reproduce this. AFAICS, there are no compiling warnings
when bootstrapping any calc files, so I don't think you have anything to
worry about.

Since as you say math-zerop is autoloaded, I don't see how you can get
this warning. Perhaps you happened to compile with an incomplete/messed
up calc-loaddefs.el. Unless you can reproduce in a clean build I would
forget about it.



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

* Re: `declare-function' and compiler warnings.
  2011-11-28 22:50 ` Glenn Morris
@ 2011-11-29  1:07   ` Jay Belanger
  0 siblings, 0 replies; 4+ messages in thread
From: Jay Belanger @ 2011-11-29  1:07 UTC (permalink / raw)
  To: Glenn Morris; +Cc: jay.p.belanger, emacs-devel


Glenn Morris <rgm@gnu.org> writes:

>> I recently noticed that compiling `calc.el' results in a compiler
>> warning: "the function `math-zerop' is not known to be defined".
>
> I also can't reproduce this.

Thanks for checking this.  (You too, Andreas.)

> Since as you say math-zerop is autoloaded, I don't see how you can get
> this warning. Perhaps you happened to compile with an incomplete/messed
> up calc-loaddefs.el.

I got the warning consistently on my other computer, but I just tried it
on a different computer with no warning.  (Up to date checkouts on both
computers.)  So I will take your advice and

> Unless you can reproduce in a clean build I would forget about it.



^ 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.