Shared coding conventions allow teams to collaborate efficiently. This rule checks that type specifiers always appear in the following order:
-
typedef
- type name, spelling of built-in types with more than one type-specifier:
- signedness -
signed
or unsigned
- last single type-specifier or
-
short int
-
long int
-
long long int
-
long double
Since the positioning of the const
keyword is controversial, this rule does not check it.
Noncompliant code example
int typedef T;
double long d;
char unsigned ch;
long signed int i;
Compliant solution
typedef int T;
long double d;
unsigned char ch;
signed long int i;