You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/08/22 19:04:19 UTC
[arrow] branch master updated: ARROW-3110: [C++] Fix warnings with
gcc 7.3.0
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 12a5755 ARROW-3110: [C++] Fix warnings with gcc 7.3.0
12a5755 is described below
commit 12a57558d4313226a6692be5dfbcd090f12a17f1
Author: Antoine Pitrou <an...@python.org>
AuthorDate: Wed Aug 22 15:04:13 2018 -0400
ARROW-3110: [C++] Fix warnings with gcc 7.3.0
Author: Antoine Pitrou <an...@python.org>
Closes #2464 from pitrou/ARROW-3110-fix-warnings-gcc-7-3-0 and squashes the following commits:
e575246e <Antoine Pitrou> ARROW-3110: Fix warnings with gcc 7.3.0
---
cpp/src/arrow/python/python_to_arrow.cc | 3 ++-
cpp/src/arrow/python/serialize.cc | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpp/src/arrow/python/python_to_arrow.cc b/cpp/src/arrow/python/python_to_arrow.cc
index 3a67696..2a75989 100644
--- a/cpp/src/arrow/python/python_to_arrow.cc
+++ b/cpp/src/arrow/python/python_to_arrow.cc
@@ -382,8 +382,9 @@ namespace detail {
template <typename BuilderType, typename AppendFunc>
inline Status AppendPyString(BuilderType* builder, const PyBytesView& view, bool* is_full,
AppendFunc&& append_func) {
- int32_t length;
+ int32_t length = -1;
RETURN_NOT_OK(internal::CastSize(view.size, &length));
+ DCHECK_GE(length, 0);
// Did we reach the builder size limit?
if (ARROW_PREDICT_FALSE(builder->value_data_length() + length > kBinaryMemoryLimit)) {
*is_full = true;
diff --git a/cpp/src/arrow/python/serialize.cc b/cpp/src/arrow/python/serialize.cc
index 3d4267b..509950d 100644
--- a/cpp/src/arrow/python/serialize.cc
+++ b/cpp/src/arrow/python/serialize.cc
@@ -87,8 +87,9 @@ class SequenceBuilder {
if (*tag == -1) {
*tag = num_tags_++;
}
- int32_t offset32;
+ int32_t offset32 = -1;
RETURN_NOT_OK(internal::CastSize(offset, &offset32));
+ DCHECK_GE(offset32, 0);
RETURN_NOT_OK(offsets_.Append(offset32));
RETURN_NOT_OK(types_.Append(*tag));
return nones_.Append(true);