From: Jay Belanger <jay.p.belanger@gmail.com>
To: emacs-devel@gnu.org
Cc: jay.p.belanger@gmail.com
Subject: `declare-function' and compiler warnings.
Date: Mon, 28 Nov 2011 13:59:36 -0600 [thread overview]
Message-ID: <87k46k587r.fsf@vh213601.truman.edu> (raw)
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
next reply other threads:[~2011-11-28 19:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-28 19:59 Jay Belanger [this message]
2011-11-28 20:13 ` `declare-function' and compiler warnings Andreas Schwab
2011-11-28 22:50 ` Glenn Morris
2011-11-29 1:07 ` Jay Belanger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k46k587r.fsf@vh213601.truman.edu \
--to=jay.p.belanger@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).