From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18214 invoked by alias); 28 Apr 2008 22:28:50 -0000 Received: (qmail 17408 invoked by uid 48); 28 Apr 2008 22:28:04 -0000 Date: Mon, 28 Apr 2008 22:28:00 -0000 Message-ID: <20080428222804.17406.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/25733] missed diagnostic about assignment used as truth value. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ianw at vmware dot com" 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: 2008-04/txt/msg02027.txt.bz2 ------- Comment #6 from ianw at vmware dot com 2008-04-28 22:28 ------- (In reply to comment #5) > (In reply to comment #4) > > Oh, just to be clear, my point was if (a=10) warns, but the extra parenthesis > > hide the warning. > > That is by design. Ok, I did try looking but is that documented anywhere? It would seem to have ramifications for people that do things like make an ASSERT statement something like #define ASSERT(v) {if (!(v))} A quick search on google codesearch showed this was a very common idiom... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25733