From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44171: Make cwarn.el obsolete Date: Fri, 23 Oct 2020 14:14:34 +0300 Message-ID: <83d019jisl.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10627"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44171@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 23 13:20:40 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kVv7g-0002fS-Lh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 13:20:40 +0200 Original-Received: from localhost ([::1]:46502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVv7f-0006d3-Ho for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Oct 2020 07:20:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVv2F-0000lm-4B for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43979) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVv2E-0007Xv-Kh for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVv2E-0006iu-D7 for bug-gnu-emacs@gnu.org; Fri, 23 Oct 2020 07:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Oct 2020 11:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44171 X-GNU-PR-Package: emacs Original-Received: via spool by 44171-submit@debbugs.gnu.org id=B44171.160345169725823 (code B ref 44171); Fri, 23 Oct 2020 11:15:02 +0000 Original-Received: (at 44171) by debbugs.gnu.org; 23 Oct 2020 11:14:57 +0000 Original-Received: from localhost ([127.0.0.1]:55525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVv29-0006iR-Fm for submit@debbugs.gnu.org; Fri, 23 Oct 2020 07:14:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVv27-0006iC-6g for 44171@debbugs.gnu.org; Fri, 23 Oct 2020 07:14:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43130) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVv21-0007SY-GA; Fri, 23 Oct 2020 07:14:49 -0400 Original-Received: from [176.228.60.248] (port=3904 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kVv20-0002Lp-VN; Fri, 23 Oct 2020 07:14:49 -0400 In-Reply-To: (message from Stefan Kangas on Fri, 23 Oct 2020 10:53:50 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:191352 Archived-At: > From: Stefan Kangas > 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.