From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6675 invoked by alias); 19 Aug 2008 22:07:00 -0000 Received: (qmail 6666 invoked by uid 22791); 19 Aug 2008 22:07:00 -0000 X-Spam-Check-By: sourceware.org Received: from perm68-235.ij.net (HELO smirk.3gfp.com) (209.216.68.235) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 19 Aug 2008 22:06:21 +0000 Received: from localhost (localhost [127.0.0.1]) by smirk.3gfp.com (Postfix) with ESMTP id D8A859B2179 for ; Tue, 19 Aug 2008 18:06:18 -0400 (EDT) Received: from smirk.3gfp.com ([127.0.0.1]) by localhost (smirk.3gfp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZkFN1Bvesk6n for ; Tue, 19 Aug 2008 18:06:16 -0400 (EDT) Received: from harveybook.swlocal (64-132-158-194.static.twtelecom.net [64.132.158.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smirk.3gfp.com (Postfix) with ESMTP id 644C89B2177 for ; Tue, 19 Aug 2008 18:06:16 -0400 (EDT) Message-ID: <48AB43D7.8070701@3gfp.com> Date: Tue, 19 Aug 2008 22:36:00 -0000 From: Richard Harvey Chapman User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: gcc Subject: Re: regarding type promotion References: <48AA5377.9080001@redpinesignals.com> <1219162574.6008.7.camel@bob-desktop> <48AAF5B6.3030704@3gfp.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00184.txt.bz2 I should have included the program source. H. hchapman@anthrax:~$ cat a.c #include int main() { unsigned int value = 1; #define BITSET 0x1234 // Wrong: always true if value is odd since BITSET == BITSET is evaluated first if (value & BITSET == BITSET) { printf("One\n"); } // Right: if ((value & BITSET) == BITSET) { printf("Two\n"); } return(0); }