Setting extra bits in a bool makes it true and false at the same time
If I get a bool variable and set its second bit to 1, then variable evaluates to true and false at the same time. Compile the following code with gcc6.3 with -g option, ( gcc-v6.3.0/Linux/RHEL6.0-2016-x86_64/bin/g++ -g main.cpp -o mytest_d ) and run the executable. You get the following. How can T be equal to true and false at the same time? value bits ----- ---- T: 1 0001 after bit change T: 3 0011 T is true T is false This can happen when you call a function in a different language (say fortran) where true and false definition is different than C++. For fortran if any bits are not 0 then the