Well, let me give an example.
I'm using the IRremote library with a Nano, and it's a Sharp TV. The library includes this function in its ir_Sharp.cpp file:
void IRsend::sendSharpRaw (unsigned long data, int nbits)
But it turns out that for this model the nunber of bits is always 15, and all the codes look like 0x4572. So an unsigned int would work fine for any valid code. So I've defined all the codes as unsigned ints, and my calling function looks like this:
void sendTV(unsigned int Output) {
irsend.sendSharpRaw(Output,15);
delay(Interval);
}
And it compiles with no warnings. So it appears the compiler is automatically converting what I'm supplying to what the library is looking for. But I wonder how much I can depend on this in other situations. Are there rules saying when this works and when it doesn't? Or is it just always bad practice?