[cfe-dev] a patch for static analyzer to check : std::list::empty()

David Blaikie dblaikie at gmail.com
Sun Feb 1 14:53:40 PST 2015


Looks like it might be a little like a recently contributed checker:
http://llvm.org/viewvc/llvm-project?view=revision&revision=226172

On Sun, Feb 1, 2015 at 2:35 PM, 彩云追月 <wuming_81 at 163.com> wrote:

> Hello,
>     recently, as an exercise, I have implemented a checker for clang
> static analyzer.It checks the call of std::list::size( ) .
>
>     It is more efficient to use containers empty() method to identify an
> empty container.Codes like bellow :
>
>     int f() {
>         list<int> l;
>         if (l.empty() == 0) {
>         }
>      }
>     will be warned.
>
>  btw, I  did my dev on the release 3.5.
>
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150201/17e12020/attachment.html>


More information about the cfe-dev mailing list