This is an automated email from the ASF dual-hosted git repository.
fsaintjacques 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 cebe82f ARROW-8962: [C++] Add explicit implementation for junk values
cebe82f is described below
commit cebe82f240cf62eff0b4343c765ad13e45662fa5
Author: Uwe L. Korn <[email protected]>
AuthorDate: Wed May 27 13:20:52 2020 -0400
ARROW-8962: [C++] Add explicit implementation for junk values
When linking the tests with `clang-4.0`, I get
```
Undefined symbols for architecture x86_64:
"arrow::internal::(anonymous
namespace)::StringToFloatConverterImpl::main_junk_value_", referenced from:
arrow::internal::StringToFloat(char const*, unsigned long, float*) in
libarrow.a(value_parsing.cc.o)
arrow::internal::StringToFloat(char const*, unsigned long, double*)
in libarrow.a(value_parsing.cc.o)
"arrow::internal::(anonymous
namespace)::StringToFloatConverterImpl::fallback_junk_value_", referenced from:
arrow::internal::StringToFloat(char const*, unsigned long, float*) in
libarrow.a(value_parsing.cc.o)
arrow::internal::StringToFloat(char const*, unsigned long, double*)
in libarrow.a(value_parsing.cc.o)
ld: symbol(s) not found for architecture x86_64
```
These older clang versions need an explicit implementation definition.
Closes #7286 from xhochy/ARROW-8962
Authored-by: Uwe L. Korn <[email protected]>
Signed-off-by: François Saint-Jacques <[email protected]>
---
cpp/src/arrow/util/value_parsing.cc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cpp/src/arrow/util/value_parsing.cc
b/cpp/src/arrow/util/value_parsing.cc
index 91b50de..9d6c0d7 100644
--- a/cpp/src/arrow/util/value_parsing.cc
+++ b/cpp/src/arrow/util/value_parsing.cc
@@ -47,6 +47,10 @@ struct StringToFloatConverterImpl {
static const StringToFloatConverterImpl g_string_to_float;
+// Older clang versions need an explicit implementation definition.
+constexpr double StringToFloatConverterImpl::main_junk_value_;
+constexpr double StringToFloatConverterImpl::fallback_junk_value_;
+
} // namespace
bool StringToFloat(const char* s, size_t length, float* out) {