[compiler-rt] r183642 - tsan: fix lint warnings

David Blaikie dblaikie at gmail.com
Fri Jun 14 09:06:58 PDT 2013


On Fri, Jun 14, 2013 at 8:56 AM, Alexey Samsonov <samsonov at google.com> wrote:
>
> On Fri, Jun 14, 2013 at 7:47 PM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> On Fri, Jun 14, 2013 at 8:40 AM, Alexey Samsonov <samsonov at google.com>
>> wrote:
>> > WDYT of replacing cpplint with ClangFormat? Or at least adding a command
>> > to
>> > automatically reformat all the sanitizers code with ClangFormat?
>>
>> Your project, not mine & I don't know the full power of the cpplint
>> tool you're using - but I assume it does more than clang-format does
>> (clang-format only makes whitespace changes - it can't tell you about
>> suspicuous casts, missing (or unnecessary) braces, etc (to guess at
>> things that cpplint might do)).
>>
>> If clang-format is sufficient for your needs, that might be nice, or
>> even if it leaves only a tiny number of cpplint issues left to deal
>> with I suppose. But mostly I just meant that the asynchronous nature
>> ("check in code, check in more code... clean up cpplint") seemed a bit
>> strange & we should pull that forward if possible (if cpplint is fast
>> enough to run interactively, that is - there seems no reason to have
>> it done so asynchronously/delayed)
>
>
> I see. Yes, cpplint is more powerful/configurable than ClangFormat. It is
> also fast enough.
> cpplint is in fact a huge and ugly python script. Do you think it's ok to
> check it in compiler-rt repo

I don't really work in that project so I'm not sure what's considered
OK there - but if cpplint-cleanliness is an invariant you're trying to
maintain it should be accessible somewhere (I mean we don't checkin
the GCC or Clang compilers that we try to keep our build working with
- we rely  on people to acquire/build them from elsewhere - it's
possible that we could say the same for cpplint, but if it's not 'big'
I think it's reasonable to just have it checked in to compiler-rt)

> and write a build system target that would (optionally) invoke it?

If as an optional target it's still accessible enough to change
developer behavior (clearly not everyone is running it on every
checkin today), sure. Otherwise I'd consider adding it to a default or
common target (like check/test or what-have-you) if practical.

> If yes,
> I'll go that way.
>
>>
>>
>> >
>> >
>> > On Tue, Jun 11, 2013 at 12:37 PM, Kostya Serebryany <kcc at google.com>
>> > wrote:
>> >>
>> >> That would be lovely indeed.
>> >>
>> >>
>> >> On Tue, Jun 11, 2013 at 12:41 AM, David Blaikie <dblaikie at gmail.com>
>> >> wrote:
>> >>>
>> >>> On Mon, Jun 10, 2013 at 3:00 AM, Dmitry Vyukov <dvyukov at google.com>
>> >>> wrote:
>> >>> > Author: dvyukov
>> >>> > Date: Mon Jun 10 05:00:54 2013
>> >>> > New Revision: 183642
>> >>> >
>> >>> > URL: http://llvm.org/viewvc/llvm-project?rev=183642&view=rev
>> >>> > Log:
>> >>> > tsan: fix lint warnings
>> >>>
>> >>> This seems to be a recurring cleanup task - is there a reason it's not
>> >>> part of the default/commonly-used build targets for compiler-rt?
>> >>>
>> >>> >
>> >>> > Modified:
>> >>> >     compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
>> >>> >
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >>> >
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >>> >
>> >>> > Modified:
>> >>> > compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
>> >>> > URL:
>> >>> >
>> >>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc?rev=183642&r1=183641&r2=183642&view=diff
>> >>> >
>> >>> >
>> >>> > ==============================================================================
>> >>> > --- compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
>> >>> > (original)
>> >>> > +++ compiler-rt/trunk/lib/lsan/lit_tests/TestCases/ignore_object.cc
>> >>> > Mon
>> >>> > Jun 10 05:00:54 2013
>> >>> > @@ -26,5 +26,5 @@ int main() {
>> >>> >    return 0;
>> >>> >  }
>> >>> >  // CHECK: Test alloc: [[ADDR:.*]].
>> >>> > -// CHECK: ignoring heap object at [[ADDR]]
>> >>> > +// CHECK: ignoring heap object at [[ADDR]]
>> >>> >  // CHECK: SUMMARY: LeakSanitizer: 1337 byte(s) leaked in 1
>> >>> > allocation(s)
>> >>> >
>> >>> > Modified:
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >>> > URL:
>> >>> >
>> >>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=183642&r1=183641&r2=183642&view=diff
>> >>> >
>> >>> >
>> >>> > ==============================================================================
>> >>> > ---
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >>> > (original)
>> >>> > +++
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
>> >>> > Mon Jun 10 05:00:54 2013
>> >>> > @@ -207,14 +207,15 @@ namespace __sanitizer {
>> >>> >    unsigned struct_ppp_stats_sz = sizeof(struct ppp_stats);
>> >>> >    unsigned struct_scc_modem_sz = sizeof(struct scc_modem);
>> >>> >    unsigned struct_scc_stat_sz = sizeof(struct scc_stat);
>> >>> > -  unsigned struct_serial_multiport_struct_sz = sizeof(struct
>> >>> > serial_multiport_struct);
>> >>> > +  unsigned struct_serial_multiport_struct_sz
>> >>> > +      = sizeof(struct serial_multiport_struct);
>> >>> >    unsigned struct_serial_struct_sz = sizeof(struct serial_struct);
>> >>> >    unsigned struct_sockaddr_ax25_sz = sizeof(struct sockaddr_ax25);
>> >>> >    unsigned struct_unimapdesc_sz = sizeof(struct unimapdesc);
>> >>> >    unsigned struct_unimapinit_sz = sizeof(struct unimapinit);
>> >>> >  #endif
>> >>> >
>> >>> > -#if !SANITIZER_ANDROID
>> >>> > +#if !SANITIZER_ANDROID
>> >>> >    unsigned struct_sioc_sg_req_sz = sizeof(struct sioc_sg_req);
>> >>> >    unsigned struct_sioc_vif_req_sz = sizeof(struct sioc_vif_req);
>> >>> >  #endif
>> >>> >
>> >>> > Modified:
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >>> > URL:
>> >>> >
>> >>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=183642&r1=183641&r2=183642&view=diff
>> >>> >
>> >>> >
>> >>> > ==============================================================================
>> >>> > ---
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
>> >>> > (original)
>> >>> > +++
>> >>> >
>> >>> > compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Mon
>> >>> > Jun 10 05:00:54 2013
>> >>> > @@ -219,7 +219,7 @@ namespace __sanitizer {
>> >>> >    extern unsigned struct_unimapdesc_sz;
>> >>> >    extern unsigned struct_unimapinit_sz;
>> >>> >  #endif
>> >>> > -
>> >>> > +
>> >>> >  #if !SANITIZER_ANDROID
>> >>> >    extern unsigned struct_sioc_sg_req_sz;
>> >>> >    extern unsigned struct_sioc_vif_req_sz;
>> >>> >
>> >>> >
>> >>> > _______________________________________________
>> >>> > llvm-commits mailing list
>> >>> > llvm-commits at cs.uiuc.edu
>> >>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >>> _______________________________________________
>> >>> llvm-commits mailing list
>> >>> llvm-commits at cs.uiuc.edu
>> >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >>
>> >>
>> >
>> >
>> >
>> > --
>> > Alexey Samsonov, MSK
>
>
>
>
> --
> Alexey Samsonov, MSK



More information about the llvm-commits mailing list