bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#44171: Make cwarn.el obsolete


From: Eli Zaretskii
Subject: bug#44171: Make cwarn.el obsolete
Date: Fri, 23 Oct 2020 14:14:34 +0300

> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 23 Oct 2020 10:53:50 +0000
> 
> cwarn.el is a package that highlights three types of "suspicious C and
> C++ constructions".
> 
> ;; * Assignments inside expressions, including variations like "+=".
> ;; * Semicolon following immediately after `if', `for', and `while'
> ;;   (except, of course, after a `do .. while' statement).
> ;; * C++ functions with reference parameters.
> 
> This was written in 1999, but is it useful today?

I'm still using it, and it sometimes shows mistakes I'm about to make.
Are there any alternatives that highlight such suspicious constructs?

> Modern compilers should warn about the above, and for the cases where
> they don't, users are probably better off using a real linter (such as
> cppcheck for C).

The point of that feature is to show you potential mistakes
_as_you_program_, without waiting for the compilation.  Besides, one
could compile while turning warnings off, in which case they will not
see the warnings at all.

> Should cwarn.el be obsoleted?

As a general rule, IMO we shouldn't lose a feature unless either
(a) there is a replacement that does at least as well; or (b) the
feature no longer makes sense at all, e.g. because the problem it
tries to solve can no longer happen.





reply via email to

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