g++ warn for conversion to bool

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

 



Hello
Is there a warning option for g++ to warn for implicit conversion to bool?

// g++-8 -Wall -o bool2 bool2.cpp
#include <stdio.h>

int main()
{
    int a = 3;
    bool b = a;

    printf("bool %d\n", b);
}


$ ./bool2
bool 1


Cheers, Jonny



[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