Ioannis Vranos said:
I mean with the unsigned char variable alone,
It's my opinion that the literal wording of the standard
differs from the stated intent for both C90/95 and C99.
The intent is that a common value to both should work as
an argument to either signed/unsigned version of an
integer rank.
However, the standard clearly ambiguates this, if not
actually precludes it, in many places. For instance,
va_arg() is required to work this way, but fprintf isn't
required to use va_arg().
The point is, if you want to be pedantic, then play it
safe.
not with an interaction with an unsigned int constant
or variable.
The reason I throw in a 0u is precisely to avoid
ambiguities around the promotion of unsigned char.
A cast would be sufficient, and more idiomatic, but
it's ugly IMHO.