TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

SR:  8.7#2

Synopsis:Initialisers for a struct or union must have compatible type
Language:C
Severity Level:2
Category:DECLARATIONS


Description:
Justification: The initialiser could be a different structure, union or enum or a pointer to a different structure or union. This behaviour is not explicitly defined in ANSI

Example:

struct coord * ptr;
struct coord point = ptr;
Here 'point' has 'coord' structure but the initialiser has pointer to coord structure making them incompatible.