Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

2.1.1 Integer Constants

Decimal, octal, and hexadecimal integral constants can be suffixed to indicate type, as shown in the following table.

Table 2-1  Data Type Suffixes
Suffix
Type
u or U
unsigned
l or L
long
ll or LL
long long (not available with -std=c89 -pedantic)
lu, LU, Lu, lU, ul, uL, Ul, or UL
unsigned long
llu, LLU, LLu, llU, ull, ULL, uLL, Ull
unsigned long long (not available with -std=c89 -pedantic)

With the -std=c99 or -std=c11, the compiler uses the first item of the following list in which the value can be represented, as required by the size of the constant:

  • int

  • long int

  • long long int

The compiler issues a warning if the value exceeds the largest value a long long int can represent.

With the -std=c89, the compiler uses the first item of the following list in which the value can be represented, as required by the size of the constant, when assigning types to unsuffixed constants:

  • int

  • long int

  • unsigned long int

  • lo ng long int

  • unsigned long long int