From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zhiwei Chen Newsgroups: gmane.emacs.bugs Subject: bug#50331: 28.0.50; Propose to obsolete cwarn.el Date: Thu, 02 Sep 2021 14:30:44 +0800 Message-ID: <87y28fa3qj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21343"; mail-complaints-to="usenet@ciao.gmane.io" Cc: andlind@gmail.com To: 50331@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 02 08:31:40 2021 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 1mLgGB-0005NE-6Q for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Sep 2021 08:31:39 +0200 Original-Received: from localhost ([::1]:46376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLgG8-0001Gx-8b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Sep 2021 02:31:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgFa-0001Fc-7e for bug-gnu-emacs@gnu.org; Thu, 02 Sep 2021 02:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLgFa-0007j7-0U for bug-gnu-emacs@gnu.org; Thu, 02 Sep 2021 02:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLgFZ-0008D1-UO for bug-gnu-emacs@gnu.org; Thu, 02 Sep 2021 02:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zhiwei Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Sep 2021 06:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50331 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163056425431535 (code B ref -1); Thu, 02 Sep 2021 06:31:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Sep 2021 06:30:54 +0000 Original-Received: from localhost ([127.0.0.1]:39456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLgFS-0008CZ-8K for submit@debbugs.gnu.org; Thu, 02 Sep 2021 02:30:54 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLgFR-0008CQ-M5 for submit@debbugs.gnu.org; Thu, 02 Sep 2021 02:30:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLgFR-00017A-1e for bug-gnu-emacs@gnu.org; Thu, 02 Sep 2021 02:30:53 -0400 Original-Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:40776) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLgFP-0007Ug-Gp for bug-gnu-emacs@gnu.org; Thu, 02 Sep 2021 02:30:52 -0400 Original-Received: by mail-pg1-x533.google.com with SMTP id 8so874827pga.7 for ; Wed, 01 Sep 2021 23:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dksm/DaTnGTPQzaWzNHEKnTWNenha4ToaUxOdpcrd/Y=; b=RgiKONKQX+Ybl38T4Kmhy94mB5NfRP47R+E1waj3rXeidHcOgU2YBnketCbdI12LwF 7fssaYsMkAPdOoedsRZ3X1A/WTFEto/rNjtmHgWUrcObOUj7sPtITSTm1eYDyZVnHuJe GKfhCF6ZNK7UkyfLiXI9Jag1AAorhGXEbpncL9RFuNpX6u5Q1EkwTnNNwUc4XxqsgSkm ENItEo+885eBFmr+NNgolv4BhkPmHFor4NVP/KDuv+g86Uvnkq0OtWr0MFTVXc625L2c UpJbynQcqwKV/8+e+EekE9VLmV6kV0hVOWVqnjSs0PNMC419lciSLbI0OKBCXXRx4cGf X24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dksm/DaTnGTPQzaWzNHEKnTWNenha4ToaUxOdpcrd/Y=; b=O3/Ax1fxDHazjAmavNWGCAxhsKpLMMj55DI7JN7NJp4SgafAu/L5HvUFipshO5+Z+8 VeZlqkfAAuRKSqnEh6NjxQFNUL7SqlLN78OWA+Lztu94OiCwQjyyikaxxEFRl85QRZ/c YSZCD3j0pkc1O2O85A9Ed2XvnjA8QOj9EAK+x9RHHcLiMSwuD5k5bn+6YOs1OfSaGgd4 L8ICArRe2HG97sSvj7x2B8rj+ytH+A6xoamAA4y/1qiwc9DrY17ghJ1aXnEavB9CJ5kT HE1ynD1Mk8ZIkvxQKWvS9LnpOu1KK1X7gBB/DInINK3Kn+j3x3p63rDuBuxYTWv5E5qP PsIg== X-Gm-Message-State: AOAM5321OEkKdsJTcvn44YFNslDoOwZMcwv4dmKDXNWl4aKLP8QtTH1D axgxa5L72zxt8dD7D+pdafk= X-Google-Smtp-Source: ABdhPJzH4J0aUG9fCVK/AiklexvlU3lOGiIn2MP8BzyURxrLVz79bgUcCzZZ7wnuJHQCCO9nPBL8nw== X-Received: by 2002:a63:703:: with SMTP id 3mr1714549pgh.400.1630564248488; Wed, 01 Sep 2021 23:30:48 -0700 (PDT) Original-Received: from Youmu (192.69.92.236.16clouds.com. [192.69.92.236]) by smtp.gmail.com with ESMTPSA id gn12sm963960pjb.26.2021.09.01.23.30.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Sep 2021 23:30:48 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=condy0919@gmail.com; helo=mail-pg1-x533.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:213227 Archived-At: Today, modern compilers can recognize the three cases described in cwarn fi= le. # semicolon after if/for/while if (value); foo(); g++ -Wall produces helpful diagnostic information: a.cpp:11:5: note: ...this statement, but the latter is misleadingly indente= d as if it were guarded by the =E2=80=98if=E2=80=99 11 | foo(); | ^~~ # assignment in expression if (x =3D 0) foo(); a.cpp:10:9: warning: suggest parentheses around assignment used as truth va= lue [-Wparentheses] 10 | if (x =3D 0); | ~~^~~ g++ -Wall does a great job. # reference parameter uses int bar(int& a) { return a; } I don't think it should be displayed in warning face, it's widely used toda= y. # conclusion Since the first two cases are not existent, and the last one is false positive (IMO), I propose to obsolete cwarn. CCed Anders Lindgren, the author of cwarn. --=20 Zhiwei Chen