This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]