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
{
uint8t one;
uint8t two;
uint8t three[18];
} testt;
static testt *mpdef;
static testt *mpabc;
void
test (void)
{
// These manipulations should trigger a warning since both pointers are not initialized.
mpdef->one = 1;
mpabc->one = 2;
}
-
Thank you for your feedback. This example depends on the assumption that the static variables still have their initial values at the time of some call to "test". We will consider this behavior with respect to the main function with possible extension to other functions on an opt-in basis for a future release. The ID for this potential enhancement is PCLP-3412.