Idea Detail view
Enable opt-in assumptions about the initial values of static variables
This condition doesn't seem to be detected by PC-lint Plus:
#include <stdint.h>
#include <string.h>
typedef struct
{
uint8_t one;
uint8_t two;
uint8_t three[18];
} test_t;
static test_t *mp_def;
static test_t *mp_abc;
void
test (void)
{
// These manipulations should trigger a warning since both pointers are not initialized.
mp_def->one = 1;
mp_abc->one = 2;
}
Pending
1 Votes