emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sea-level rise of byte-compilation warnings [was: Fixing...byte-comp


From: Artur Malabarba
Subject: Re: sea-level rise of byte-compilation warnings [was: Fixing...byte-compilation warnings...]
Date: Mon, 16 Nov 2015 23:48:05 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Drew Adams <address@hidden> writes:

> Perhaps we should just remove one or two of the shiploads
> of warnings that have been piled on in the last few years?
>
> Or at least provide clear guidelines for 3rd-party
> libraries, as to how to make the code itself warningless
> when byte-compiled by its users.

In my experience, 90% of the superfluous warnings are silenced by a
`defvar' or a `declare-function'. Finally, with-no-warnings should cover
the last 10. If this isn't well documented it really should be.

The reason we can't just remove one or two shiploads of these warnings
is that they could be pointing to actual problems (in my experience,
about 1/3 of the time they are), such as functions/variables that
weren't required.

> The degree of warning is now overkill in many contexts
> (even for novices, it could be argued).

I don't usually feel overwhelmed by the warnings. Most of my elisp files
have 0 to 3 of these warning-suppressing forms. Only the really large
projects with 10+ files end up having a lot.

I'm curious what are your contexts. I guess you're supporting Emacs
versions < 24.1?

> What is needed is to:
>
> * be able to notice the important ones, while also
>   showing ones that are less important

Different warning levels might be nice, but (looking at
`byte-compile-warnings') the only warnings that don't immediately mean
“this code might break” are the `cl-functions', `obsolete', and
`mapcar'. So I don't know how much it would help your warning flood.

> * be able to have the code itself easily (and
>   conditionally) inhibit them - as a whole or by type

Like I said, with-no-warnings inhibits them locally, but I perfectly
agree there should be a way to suppress warnings on a file-local (and
maybe dir-local) basis.

> FWIW, my crystal ball whispers that just analyzing
> the code for sexps that are protected by `fboundp'
> might go a long way toward eliminating many spurious
> warnings.

My psychic senses agree.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]