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

SR:  8.7#1Checked automatically with code checker

Synopsis:The initialiser for a struct, union or array bound, must be enclosed in braces.
Language:C
Severity Level:2
Category:DECLARATIONS


Description:
The ANSI standard does not define the behaviour of implementations when confronted with initialiser lists which are not brace enclosed.

Example:

typedef struct coord
{
int x;
} Coord;
...
Coord origin = 0; /* undefined behaviour*/

Example:

typedef struct coord
{
int x;
} Coord;
...
Coord mpoint = {0}; /* legal */