Implicitly widening the type of a function argument or a return expression is disallowed by MISRA-C:2004 Rule 10.1, as illustrated in the following code snippet:
void foo1(int16_t x);
int16_t foo2(void)
{
int8_t s8a;
...
foo1(s8a); /* not compliant */
...
return s8a; /* not compliant */
}
But, in my understanding, they're no different than the assigning situation:
s16a = s8a; /* compliant */
What's the point? Thanks.