![]() |
![]() |
2855 | ![]() |
||||
![]() | |||||||
| Conversion to signed | |||||||
A constant expression is being cast 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 = (signed char)127; /* */
sca = (signed char)130; /* 2855 */
sca = (signed char)(-127); /* */
sca = (signed char)(-130); /* 2855 */
}
MISRA-C:2004 Rules applicable to message 2855:
| Rule 3.1 (Required) | All usage of implementation-defined behaviour shall be documented. |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |