This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
bug - pointer to false
Using GCC 3.3.1 I ran into this bug:
// g++ -pedantic -W -Wall foo.cpp
int main()
{
int* p = 0;
// 0 is okay.
p = 0;
// false should cause a compile error,
// "error: cannot convert `bool' to `int*' in assignment"
// but it did not!
// (Keep in mind "false" is typed to bool.)
p = false;
}
Has this bug been fixed in a later version, GCC 3.3.2+ or GCC 3.4.x?
Or did I miss a compile flag to enable this error?
Thanks,
--Eljay