The pointer validity checking can produce misleading error messages in some cases. For example, a non-NULL but invalid pointer that has no associated pointer target information may be reported as "attempt to dereference a NULL pointer.", as in the following example where a non-pointer is implicitly cast to a pointer when passed to ctime():
time_t test;
time(&rawtime);
ctime(rawtime);
In this particular case the error should have been caught at compile time, but in general we should update the runtime errors reported from pointer checking to reflect whether the pointer is genuinely NULL or it simply has no known target.
The pointer validity checking can produce misleading error messages in some cases. For example, a non-NULL but invalid pointer that has no associated pointer target information may be reported as "attempt to dereference a NULL pointer.", as in the following example where a non-pointer is implicitly cast to a pointer when passed to ctime():
In this particular case the error should have been caught at compile time, but in general we should update the runtime errors reported from pointer checking to reflect whether the pointer is genuinely NULL or it simply has no known target.