既然您已经有了一个质量保证团队,那么让我补充一点关于质量保证的小问题。一些针对 C 语言的自动 QA 工具会将释放的指针的分配标记为“对 ptr的无用分配”。例如,Gimpl 软件公司的 PC-lint/FlexeLint 说
tst.c 8 Warning 438: Last value assigned to variable 'nPtr' (defined at line 5) not used
*ptr = 20; //Points to 0x1000
free(ptr);
int *q = (int *)malloc(sizeof(int) * 2); //Points to 0x1000
*ptr = 30; //Since ptr and q are pointing to the same address, so the value of the address to which q is pointing would also change.