[cfe-dev] null pointer warning
Chris Lattner
clattner at apple.com
Mon Jul 5 12:20:30 PDT 2010
Hi All,
I'm trying to implement a warning for PR7569, patch attached:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: null-pointer-warning.patch
Type: application/octet-stream
Size: 3317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100705/f8fe40f2/attachment.obj>
-------------- next part --------------
The problem is that in SemaExpr, I don't know the surrounding context for a dereference, causing the warning to trigger on cases like this:
void* t3 = &(*(void*)0);
While this is technically a null pointer dereference, warning about this isn't particularly useful.
Is there a better place to slot this into Sema? I didn't follow the warning work John did, but it seems like it must have had to solve similar problems.
-Chris
More information about the cfe-dev
mailing list