This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17705] New: Testing a bool using true doesn't work
- From: "bliss1940-bbs at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Sep 2004 22:35:45 -0000
- Subject: [Bug c++/17705] New: Testing a bool using true doesn't work
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
bool fred = true;
if(fred == true) {
int something = 2; // never gets here
}
The problem is the expression (fred == true) evaluates as false.
This seems to occur only with avr-gcc. Linux gcc works as expected.
To further examine this you can add this code:
int fredValue = fred;
int trueValue = true:
I find that fred = 0x0001 and true = 0xffff.
--
Summary: Testing a bool using true doesn't work
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bliss1940-bbs at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: gcc 3.4.1
GCC host triplet: mingw32
GCC target triplet: avr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17705