Subject: Re: bug#21466: [PATCH] Avoid defining (temporarily) vars and functions

From: Alan Mackenzie <[email-masked]>
Date: Sat, 26 Mar 2022 19:51:35 +0000

Hello, Lars.

On Sat, Mar 26, 2022 at 17:47:24 +0100, Lars Ingebrigtsen wrote:
> Alan Mackenzie <[email-masked]> writes:

> > These explain the "free variable" warnings for the variables and the
> > "defined multiple times" warnings for the functions.

> > To sort out this bug properly, we really need Lisp functions equivalent
> > to C's extern.  (defvar foo) and (declare-function 'foo nil) currently
> > don't fill this need.

> I had a brief look at a couple of the warnings (after the patch), and it
> looks like the warnings could be resolved by just removing the
> cc-bytecomp-deffun (and rearranging the code order).

The whole patch was predicated on:

    >>>> It might have made sense back in the days when the
    >>>> byte-compiler did not offer built-in ways to silence those
    >>>> warnings, but nowadays we can do better.

I'm not convinced that what the byte compiler currently offers is
"better", if that involves having to rearrange things in a source file.
And even then, that would only resolve two of the ~15 warning messages.

By contrast, leaving things alone is not causing any trouble, and seems
unlikely to cause trouble in the near future.

There is currently no clean way of declaring a symbol's variable or
function cell as bound for the byte compiler.  Perhaps there should be.

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no

-- 
Alan Mackenzie (Nuremberg, Germany).