The first tip in Warning Tips - GNU Emacs Lisp Reference Manual:
Try to avoid compiler warnings about undefined free variables, by adding dummy defvar definitions for these variables, like this: (defvar foo) Such a definition has no effect except to tell the compiler not to warn about uses of the variable foo in this file.
What is a scenario where someone would want no effect and yet want to disable the warning about the free variable? Whenever I got warnings about undefined free variables, it was always the case that either I forgot to put (defvar foo initvalue docstring)
or I misspelled a local variable name.