![]() |
![]() |
2850 | ![]() |
||||
![]() | |||||||
| Conversion to signed | |||||||
A constant expression is being implicitly converted to a signed type which is not large enough to represent the value. The results of this operation will be implementation-defined. For example:
/*PRQA S 274,2017,2984,2982,2983,2986,3120,3203,3211,3408,3602 ++*/
extern void foo(void)
{
signed char sca;
sca = 127; /* */
sca = 130; /* 2850 */
sca = -127; /* */
sca = -130; /* 2850 */
}
MISRA C:2012 Rules applicable to message 2850:
| Rule-10.3 (Required) | The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category. |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |