This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug 4/ bool
- To: egcs-bugs at cygnus dot com
- Subject: bug 4/ bool
- From: Breymann at t-online dot de (Breymann)
- Date: Mon, 22 Dec 1997 16:41:36 +0100
gcs-1.0 (linux)
bool does not behave as expected (see testcase below).
best wishes!
Uli
***** test case ****
#include<iostream.h>
int main()
{
bool logicalValue;
if(logicalValue)
{
cout << "true\n";
logicalValue = !logicalValue; // negation
if(logicalValue)
cout << "Error! logicalValue must be false here!\n";
}
else cout << "logigalValue by accident initialized with false\n";
}
The program shows the error message, i.e. negation does not work.
Reason: wrong initialization of bool objects, should be undefined, but
either true or false