MISRAC++2008-5-0-8
In this section:
Synopsis
(Required) An explicit integral or floating-point conversion shall not increase the size of the underlying type of a cvalue expression.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
One or more explicit integral or floating-point conversions were found that increase the size of the underlying type of a cvalue expression.
Coding standards
This check does not correspond to any coding standard rules.
Code examples
The following code example fails the check and will give a warning:
#include <stdint.h>
void f ( )
{
int16_t s16;
int32_t s32;
s32 = static_cast< int32_t > ( s16 + s16 ); // Non-compliant
}
The following code example passes the check and will not give a warning about this issue:
#include <stdint.h>
void f ( )
{
int16_t s16;
int32_t s32;
s32 = static_cast< int32_t > ( s16 ) + s16 ; // Compliant
}