[Bug c++/17705] New: Testing a bool using true doesn't work

bliss1940-bbs at yahoo dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 27 22:35:00 GMT 2004


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



More information about the Gcc-bugs mailing list