The C language allows anonymous struct and enum definitions in type definitions. Using such definitions prevents the compiler from properly applying program-level interprocedural analysis. Make sure to give names to structures and enumerations in type definitions. The following listing shows an example of unnamed structures and enumerations.
/* In C, the types x_rec and y_enum each represent a structure and an enumeration with no name. In C++ these same statements define a type x_rec and y_enum, a structure named x_rec and an enumeration named y_enum. */ typedef struct { int a, b, c; } x_rec; typedef enum { Y_FIRST, Y_SECOND, Y_THIRD } y_enum;
The following listing shows a suggested solution.
typedef struct x_rec { int a, b, c; } x_rec; typedef enum y_enum { Y_FIRST, Y_SECOND, Y_THIRD } y_enum;