From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11691 invoked by alias); 8 Apr 2010 10:49:01 -0000 Received: (qmail 11668 invoked by uid 22791); 8 Apr 2010 10:49:01 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Apr 2010 10:48:56 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o38AmsEs014226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 8 Apr 2010 06:48:54 -0400 Received: from hase.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o38AmqQe030782; Thu, 8 Apr 2010 06:48:53 -0400 From: Andreas Schwab To: Jakub Jelinek Cc: Ulrich Drepper , Glibc hackers Subject: Re: [PATCH] Tweak assert -DNDEBUG for the new -Wunused-but-set-{variable,parameter} warnings References: <20100408102141.GO3601@sunsite.ms.mff.cuni.cz> X-Yow: Why is it that when you DIE, you can't take your HOME ENTERTAINMENT CENTER with you?? Date: Thu, 08 Apr 2010 10:49:00 -0000 In-Reply-To: <20100408102141.GO3601@sunsite.ms.mff.cuni.cz> (Jakub Jelinek's message of "Thu, 8 Apr 2010 12:21:41 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00004.txt.bz2 Jakub Jelinek writes: > The following patch shouldn't result in worse code generation (not > even with -O0 I believe) with -DNDEBUG, should quiet that warning > and also allow some checking of expr. With -DNDEBUG assert will > happily accept even syntax errors within its arguments etc., which > would only show up without -DNDEBUG, this patch ought to cure that > too. Alternative to the 0 && (expr) could be sizeof (expr) or > something else where the expression isn't evaluated, but is parsed. I don't think this is allowed, as the standard explicitly says that the argument is ignored when NDEBUG is defined. Andreas. -- Andreas Schwab, schwab@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."