implicit conversion warnings

Jonny Grant jg@jguk.org
Fri May 24 19:48:00 GMT 2019


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



More information about the Gcc-help mailing list