Hi,
In MISRA-C 2004: Rule 10.4: The value of a complex expression of integer type may only be cast to a type that is narrower and of the same signedness as the underlying type of the expression.
Rule 10.3: The value of a complex expression of floating type may only be cast to a type that is narrower floating type.
So why should the cast be more narrow? The Guidelines gives a reference to section 6.10, but don't offer much insight. The only consequence I see is that the result potentially missing the most significant bits.
Anyone who cares to enlighten me?
Eirik