impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Impala Public Jenkins (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-2615: warn if Status is ignored
Date Fri, 13 Jan 2017 03:02:03 GMT
Impala Public Jenkins has submitted this change and it was merged.

Change subject: IMPALA-2615: warn if Status is ignored
......................................................................


IMPALA-2615: warn if Status is ignored

This introduces a WARN_UNUSED_RESULT macro. It can be used at the end
of function declarations to issue warnings if the return value of the
function is implicitly ignored by the caller. E.g. if a Status or
bool return value indicates the success/failure of a method.

It can also be prepended to function definitions (gcc doesn't allow
it to be put before the { in function definitions).

This can help find bugs. E.g. I found IMPALA-4391 by applying this
to some other places in HdfsScanner.

This commit uses the macro in a few key APIs. We can use it in more
places if we agree on the pattern.

Note:
Gcc has a bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38172
that prevents this from being effective for many functions that
return C++ classes or structs. Clang does not have this issue.

Change-Id: I8c26e7532b5f2c7fe167accc73179e8b72b192bc
Reviewed-on: http://gerrit.cloudera.org:8080/4878
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
---
M be/src/common/status.h
M be/src/exec/exec-node.h
M be/src/exec/hdfs-scan-node-base.cc
M be/src/runtime/bufferpool/buffer-allocator.h
M be/src/runtime/bufferpool/buffer-pool.h
M be/src/runtime/bufferpool/reservation-tracker.h
M be/src/runtime/disk-io-mgr-stress.cc
M be/src/runtime/disk-io-mgr-test.cc
M be/src/runtime/disk-io-mgr.cc
M be/src/runtime/disk-io-mgr.h
M be/src/runtime/mem-tracker.h
M be/src/runtime/test-env.cc
M be/src/runtime/tmp-file-mgr-test.cc
M be/src/runtime/tmp-file-mgr.h
M be/src/util/openssl-util.h
15 files changed, 112 insertions(+), 96 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Tim Armstrong: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/4878
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c26e7532b5f2c7fe167accc73179e8b72b192bc
Gerrit-PatchSet: 8
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>

Mime
View raw message