Synopsis: | All variables containing a pointer shall be initialized. |
Language: | C |
Severity Level: | 6 |
Category: | Declarations |
Description: |
Justification In this way uninitialized memory is banned out. Example int* i; /* WRONG, pointer not initialized */ int* j = NULL; /* RIGHT */ typedef struct Foo { int* x; } Foo; Foo foo1; /* WRONG, struct containing pointer not initialized */ Foo foo2 = {0}; /* RIGHT, struct initialized */ |