From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6468 invoked by alias); 27 Sep 2004 16:24:37 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 6448 invoked from network); 27 Sep 2004 16:24:36 -0000 Received: from unknown (HELO masquerade.micron.com) (137.201.242.130) by sourceware.org with SMTP; 27 Sep 2004 16:24:36 -0000 Received: from mail-srv1.micron.com (localhost [127.0.0.1]) by masquerade.micron.com (8.12.9/8.12.2) with ESMTP id i8RGMnoN011215 for ; Mon, 27 Sep 2004 10:22:50 -0600 (MDT) Received: from ntxboimbx07.micron.com (ntxboimbx07.micron.com [137.201.80.94]) by mail-srv1.micron.com (8.12.9/8.12.2) with ESMTP id i8RGMiuK011207; Mon, 27 Sep 2004 10:22:45 -0600 (MDT) From: lrtaylor@micron.com content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: problem with C++ keyword true Date: Mon, 27 Sep 2004 16:24:00 -0000 Message-ID: <363801FFD7B74240A329CEC3F7FE4CC40215DBF5@ntxboimbx07.micron.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: To: , X-Scanned-By: MIMEDefang 2.37 X-SW-Source: 2004-09/txt/msg00303.txt.bz2 Well, that may be a bug. Than again, if this is a large program (and you didn't write all of it), I'm wondering if someone went and #define'd true, overriding the C++ definition of it... Also, don't forget that you don't actually have to do the comparison. You can simply do this: if (george) { If george evaluates to any non-zero value, it will be considered to be true. Thanks, Lyle -----Original Message----- From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On Behalf Of Steve Bliss Sent: Monday, September 27, 2004 4:50 AM To: gcc-help@gcc.gnu.org Subject: problem with C++ keyword true I'm using avr-gcc version 3.4.1 to compile C++. Here's the problem: bool george =3D true; if(george =3D=3D true) { // never gets here } else { // always gets here } In other words, the expression (george =3D=3D true) is always false. Isn't this a compiler bug? For whatever it's worth, the value of george is 0x01 and the value of true seems to be 0xff.