23-08-2006, 10:20 AM
MISRA-C meeting 23-8-2006.
Having made the cast explicit, it is still necessary to be sure that the cast results in no loss of infomation.
The cast makes it clear this is a 16 bit constraint.
Implicit narrowing casts are prohibited by 10.1.
Code:
s16c = (int16_t)(s32a * s32b);
Having made the cast explicit, it is still necessary to be sure that the cast results in no loss of infomation.
The cast makes it clear this is a 16 bit constraint.
Implicit narrowing casts are prohibited by 10.1.
Posted by and on behalf of the MISRA C Working Group