impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-3676,4321: Use clang as a static analysis tool
Date Wed, 19 Oct 2016 21:58:18 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-3676,4321: Use clang as a static analysis tool

Patch Set 1:

File be/CMakeLists.txt:

PS2, Line 104: corredt

Line 106: SET(CXX_FLAGS_TIDY "${CXX_FLAGS_TIDY} --gcc-toolchain=${GCC_ROOT}")
We already set this in CLANG_BASE_FLAGS below - not sure why it's done separately, but we
should combine it.
File be/src/benchmarks/

Line 167: #include "exprs/"
I think you can just remove the include and it will be linked the normal way.
File be/src/common/logging.h:

Line 45
I take it this is no longer necessary?
File be/src/common/names.h:

Line 35: #if defined(_GLIBCXX_VECTOR) || defined(_LIBCPP_VECTOR)
> Make this file work with libc++, the clang standard library implementation
I feel we shouldn't do this unless we actually intend to get libcpp working end-to-end and
test it automatically (which I don't think we do), because it makes it harder to maintain
this file and causes confusion about what we do/don't support.
File be/src/common/status.h:

PS2, Line 212: with DCHECKS off, this might deref a nullptr
We shouldn't actually be dereferencing a NULL pointer - is it just that clang-tidy can't infer
that the pointer is non-NULL, right?
File be/src/exec/delimited-text-parser.h:

Line 169: 
Was this just cleanup or the result of a clang-tidy warning?
File be/src/experiments/bit-stream-utils.8byte.inline.h:

How about we just delete this? Probably not worth maintaining it.
File be/src/exprs/

Line 175
I think we still want to have the declarations up the top of the .cc file so that storage
is allocated, e.g. constexpr int AggregateFunctions::HLL_PRECISION;

Otherwise some of the DCHECK macros fail in strange ways. E.g. DCHECK_LE(prec, HLL_PRECISION)
takes the address of both arguments.
File be/src/exprs/

PS2, Line 176: static
I don't think we want static scope since it's a local variable.
File be/src/runtime/buffered-tuple-stream.h:

Line 450:   const bool read_write_;
Can you reorder so that we have:

const members (read_write_/has_nullable_tuple_)
non-const members (closed_/pinned_/delete_on_read_/use_small_buffers_)

It feels a little jumbled

Line 456:   /// If true, this stream has been explicitly pinned by the caller. This changes
Need blank line before.
File be/src/runtime/coordinator.h:

I don't think we should reorder members here since there was some logical grouping before.
File be/src/runtime/string-buffer.h:

Line 27: using strings::Substitute;
How about we just use strings::Substitute below?
File be/src/util/aligned-new.h:

Line 25: // Objects that must be allocated at alignment greater than that promised by the
This doesn't help if the class is embedded in another classes, right? Would be good to call
that out.

PS1, Line 27: template <size_t ALIGNMENT>
Do classes that inherit from this also need to set __attribute__((aligned ? Would be good
to document that this doesn't guarantee anything about alignment if the object is allocated
in some other way.

Line 42:       throw std::bad_alloc();
We don't catch this exception so it would be better to do a LOG(FATAL).
File be/src/util/

Line 70: class MultiThreadTest { // NOLINT: members are not arranged for minimal padding
I think we should just remove this warning if it's insisting on us packing all of our structs.
File be/src/util/buffer-builder.h:

Line 33:   
Fix the whitespace here?
File be/src/util/runtime-profile.h:

Line 335
Let's not move these around, there was some logic to the grouping
File be/src/util/

Line 425:   sq_printf(connection, headers.c_str(), (int)str.length());
> printf with non-literal format is a security concern, but it should be OK h
I think this needs a comment
File bin/

Line 260: export IMPALA_GOOGLETEST_VERSION=20151222
I feel like we should add the latest release to the toolchain instead of using a random year-old
File bin/

PS1, Line 26: quote

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I4ed168488cb30ddeccd0087f3840541d858f9c06
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Jim Apple <>
Gerrit-Reviewer: Jim Apple <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message