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++/17452] New: ~ operator on bool type


GCC version: 3.2.3
System type: Linux Redhat 7

Complete code snippet:
#include <stdio.h>
int main () {
  bool bar;
  b = 1;
  b = ~b;
  printf ("%x", bar);
  return 0;
}

Compiler options: -Wall

The value printed from the resulting executable showed the value of 'bar' to 
be '1' instead of the expected boolean value '0'.

-- 
           Summary: ~ operator on bool type
           Product: gcc
           Version: 3.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bygoh at genting dot com dot my
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17452


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