[cfe-commits] [Patch][Review request]Add source range to undefined return value warning

Jim Goodnow II jim at thegoodnows.net
Mon Aug 30 15:10:09 PDT 2010


Hi,

I'm new to the Clang list and while reading through the static 
analyzer code, noticed some inconsistencies and thought I would make 
some minor revisions to get the hang of things. In this case, I 
noticed that the warning for returning an undefined value didn't flag 
the value, just the return keyword. Please let me know if this is the 
proper protocol. For instance, when you attach a .patch file, should 
you include the text of the patch in the e-mail as well? Thanks.

  - jim

Index: lib/Checker/ReturnUndefChecker.cpp
===================================================================
--- lib/Checker/ReturnUndefChecker.cpp	(revision 112505)
+++ lib/Checker/ReturnUndefChecker.cpp	(working copy)
@@ -61,6 +61,7 @@
    EnhancedBugReport *report =
      new EnhancedBugReport(*BT, BT->getDescription(), N);

+  report->addRange(RetE->getSourceRange());
    report->addVisitorCreator(bugreporter::registerTrackNullOrUndefValue, 
RetE);

    C.EmitReport(report);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReturnUndefChecker.patch
Type: application/octet-stream
Size: 483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100830/d7115e1c/attachment.obj>


More information about the cfe-commits mailing list