Why does the assignment generate a warning?
You have a super power: you can make friends with any dog. You are put into a box that says "the person in this box can make friends with any animal". Then someone puts a tiger in your box. How's your day going now?
Now do you see why the assignment is a warning? You have a method that states it can accept any pointer to myst
and you are putting it in a box that says "the function pointed to by this pointer can accept a pointer to anything". That's potentially dangerous; what's stopping the user of that function pointer from passing a pointer to a tiger into the function?
Why does the compiler suppress the warning when there is a cast?
Because that's the purpose of a cast. A cast operator means "compiler, I know the thing I am doing is crazy dangerous but I mean to do it and know it will work, so stop giving me warnings and errors about this crazy conversion". Casts effectively turn off the safety system. If that's not what you mean to do then don't write a cast.