[PATCH] D12759: [clang-tidy] Add misc-sizeof-container check to find sizeof() uses on stlcontainers.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 13 02:22:28 PDT 2015


I've also found a bunch of similar cases in our codebase, and I'm trying to
figure out whether the pattern can be narrowed down to just dangerous
cases. If we don't find a way to do so, we'll probably have to resort to
"// NOLINT" to shut clang-tidy up.
On 13 Sep 2015 10:52, "Kim Gräsman" <kim.grasman at gmail.com> wrote:

> Late to the party, but I wanted to ask: is there a way to indicate to
> the checker that we really *did* mean sizeof()?
>
> I think I've stumbled over code in our code base that uses
> sizeof(container) to report memory usage statistics and it seems
> valid, so it'd be nice if this checker could be silenced on a
> case-by-case basis.
>
> Thanks,
> - Kim
>
> On Sat, Sep 12, 2015 at 12:09 AM, Alexander Kornienko via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Indeed. But this has been fixed before I could get to it.
> >
> >
> > On Thu, Sep 10, 2015 at 10:47 PM, Aaron Ballman via cfe-commits
> > <cfe-commits at lists.llvm.org> wrote:
> >>
> >> aaron.ballman added a comment.
> >>
> >> This appears to have broken one of the bots:
> >>
> >> http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/15065
> >>
> >>
> >> http://reviews.llvm.org/D12759
> >>
> >>
> >>
> >> _______________________________________________
> >> cfe-commits mailing list
> >> cfe-commits at lists.llvm.org
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150913/3a1f5119/attachment.html>


More information about the cfe-commits mailing list