bug - pointer to false

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux