Why is this an issue?

Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule allows to check that all user-defined type names match a provided regular expression. Different regular expressions can be provided for enum types and other types.

How to fix it

Code examples

Noncompliant code example

With default regular expression for enum types ^[a-z]+[a-z0-9_]*_e:

typedef enum {RED, YELLOW, GREEN} light;

With default regular expression for other types ^[a-z]+[a-z0-9_]*_t:

typedef unsigned shortint MyType;

Compliant solution

With default regular expression for enum types ^[a-z]+[a-z0-9_]*_e:

typedef enum {RED, YELLOW, GREEN} light_e;

With default regular expression for other types ^[a-z]+[a-z0-9_]*_t:

typedef unsigned shortint my_type_t;

Resources

Articles & blog posts