Create a test file like:
test.el:
========
(cond
((featurep 'xemacs)
(defun bar ()
(message "bar XEmacs"))
(defun foo ()
(bar)))
(t
(defun bar ()
(message "bar Emacs"))
(defun foo ()
(bar))))
(defun foobar ()
(interactive)
(foo))
========
Now byte-compile the file above.
The byte-compiler gives the following warning:
In end of data:
test.el:17:1:Warning: the following functions are not known to be
defined:
bar, foo
But aren't these functions (bar and foo) defined using cond construct?
Why does the byte-compiler give this warning?
The byte-compiler only considers as defined a function which is trivially
obviously defined without having to do any kind of analysis. I.e. it
doesn't look inside conditionals (or even inside `let's) to figure out what
might be defined in there.
A workaround I use sometimes is
(defalias 'foo
(if <toto>
(lambda (bla) bli)
(lambda (blo) blu)))
When the condition <toto> is used for several functions, this is a bit
inconvenient, tho.