1. If a function defined as:
void test_function(unsigned int a)
{
}
Is "test_function(-256);" going to cause undefined behavior?
No, but it might cause unexpected errors in the function if such a
value is not valid and the function does not check for it. The value
-256 will be converted, as if by assignment, to an unsigned int to
pass to the function.
Assigning a negative value to a unsigned integer type can never
overflow and the result is always well-defined. In this case, the
unsigned int value passed will be UINT_MAX + 1 - 256. That's 65280
for typical 16 bit ints, or 4294967040 for typical 32 bit ints, but
other values are possible.
2. What's "a negative signed value wrapping"?
No such thing in C. Overflowing or underflowing a signed integer type
produces undefined behavior.
3. Is bit-shifting on a signed int undefined behavior? Why?
It is possible that some bit patterns, when interpreted as a signed
integer type, do not compose a valid value for that type. This is
called a trap representation, and dealing with such produces undefined
behavior. When shifting a signed integer, it is possible that a trap
representation may be produced.
Aside from that, it is implementation-defined whether right shifting a
signed integer type preserves the sign bit.