implicit conversion warnings

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

 



Hi!

Is there a way for gcc to warn when integers are silently converted to true/false (bool type)?

I tried a few options, but none warned, eg:
-Wconversion
-Wsign-conversion


#include <cstdio>

void f(bool t)
{
   printf("t %d\n", t);
}

int main()
{
    f(3);
    f(-1);
}

Thanks, 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