Yes. The most trivial example is probably (C++):
Foo* foo = malloc( sizeof(Foo) ); // warning: void* to Foo*
But this is entirely valid as long as Foo is a POD type, or as long as you use placement new afterwards.The most annoying warning ever is probably:
while ( true ) // warning: conditional expression is constant
{
foo();
if ( bar() )
break;
baz();
}
Thanks, compiler! <facepalm>It's silliness like this which has caused many people to kneejerk ignore every warning ever. But in doing so, they don't realize they're throwing away a lot of free data about their codebase, while also encouraging dangerous coding practices.