[PATCH] Add _wassert to known noreturn functions
Reid Kleckner
rnk at google.com
Mon Nov 11 19:37:03 PST 2013
True, I forgot that. However, it's probably useful for the static analyzer
to consider it noreturn for analysis purposes.
On Mon, Nov 11, 2013 at 7:32 PM, Alp Toker <alp at nuanti.com> wrote:
> _wassert can emit a warning and return control depending on the flag /
> dialog input, no?
>
> Alp.
>
> On 12/11/2013 00:55, Reid Kleckner wrote:
> > Seems reasonable, but can you add a test?
> >
> >
> > On Mon, Nov 11, 2013 at 12:18 PM, Anders Montonen
> > <Anders.Montonen at iki.fi <mailto:Anders.Montonen at iki.fi>> wrote:
> >
> > Microsoft's library headers do not annotate _wassert as being a
> > noreturn function, causing analyzer false positives. Fix by adding
> > it to NoReturnFunctionChecker's list of known noreturn functions.
> >
> > -a
> >
> > diff --git
> > a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
> > b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
> > index d7a880c..1367021 100644
> > --- a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
> > +++ b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp
> > @@ -64,6 +64,7 @@ void
> > NoReturnFunctionChecker::checkPostCall(const CallEvent &CE,
> > .Case("assfail", true)
> > .Case("db_error", true)
> > .Case("__assert", true)
> > + .Case("_wassert", true)
> > .Case("__assert_rtn", true)
> > .Case("__assert_fail", true)
> > .Case("dtrace_assfail", true)
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> >
> >
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> --
> http://www.nuanti.com
> the browser experts
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131111/56715074/attachment.html>
More information about the cfe-commits
mailing list