![]() |
![]() |
1281 | ![]() |
||||
![]() | |||||||
| Constants | REFERENCE - ISO:C90-6.1.3.2 (Integer Constants) | ||||||
This integer constant is of an unsigned type but does not have a "U" suffix. Note that the type of an integer constant depends on its value and the implemented size of an int (e.g. whether it is a 16 bit or 32 bit quantity) as well as the presence of suffixes. More ... In the following examples, the size of an int is assumed to be 16 bits:
/*PRQA S 1277,1279,2017,3120,3198,3199,3203,3408 ++*/
/**************************************
* OPTIONS: -s int=16
*************************************/
extern void foo(void)
{
unsigned long ula;
ula = 2147483648; /* Message 1281 and 1255 */
ula = 0x8000; /* Message 1281 and 1255 */
ula = 0x80000000; /* Message 1281 and 1255 */
ula = 0x80000000L; /* Message 1281 and 1254 */
}
MISRA C:2012 Rules applicable to message 1281:
| Rule-7.2 (Required) | A "u" or "U" suffix shall be applied to all integer constants that are represented in an unsigned type |
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 |