[previous] 1281 [next] Integer literal constant is of an unsigned type but does not include a "U" suffix.
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 */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents