[Development] Compiler warnings

Christian Kandeler christian.kandeler at digia.com
Fri Oct 17 13:10:41 CEST 2014


On 10/17/2014 01:06 PM, Milian Wolff wrote:
> I think you are missing something:
>
> enum Foo {
> Bar = 1, Baz = 2
> };
>
> Foo foo = static_cast<Foo>(3);

If you start to guard against this kind of stuff, where does it end?

void f(void *p);

f(reinterpret_cast<void *>(5));

Is f supposed to catch that?


Christian




More information about the Development mailing list