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

Ted Kremenek kremenek at apple.com
Mon Aug 30 18:37:08 PDT 2010


Good catch!  Applied here:

http://llvm.org/viewvc/llvm-project?view=rev&revision=112569

On Aug 30, 2010, at 3:10 PM, Jim Goodnow II wrote:

> 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);<ReturnUndefChecker.patch>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list