From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12888 invoked by alias); 11 Feb 2009 23:04:57 -0000 Received: (qmail 12853 invoked by uid 48); 11 Feb 2009 23:04:42 -0000 Date: Wed, 11 Feb 2009 23:04:00 -0000 Message-ID: <20090211230442.12852.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/32061] (Wlogical-op) wording of warning of constant logicials need improvement In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-02/txt/msg01017.txt.bz2 ------- Comment #3 from manu at gcc dot gnu dot org 2009-02-11 23:04 ------- Confirmed. I have a patch for this for 4.5. The new wording will say: warning: logical 'or' applied to non-boolean constant. Are you satisfied with this? > > BTW, why no warning for this? > resp == 0 && 0 > Naturally, all the above constants will hide behind some macros which could > indicate a real error, hence the value of the warning. Warning for (x && 0) or (x && 1) would produce hundreds of false positives. We shouldn't warn about your testcase either. -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu dot org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2009-02-11 23:04:41 date| | Summary|wording of warning of |(Wlogical-op) wording of |constant logicials need |warning of constant |improvement |logicials need improvement http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32061