Skip to content

[C++][FlightSQL][ODBC] Build error with deprecated C++-17 feature #46576

Closed

Description

@hiroyuki-sato

Describe the bug, including details regarding any error messages, version, and platform.

  • soruce: 153da30
  • macOS: 14.7.1
  • clang: Apple clang version 16.0.0 (clang-1600.0.26.6)
git clone https://github.com/apache/arrow/
cd arrow/cpp
mkdir build
cd build
cmake .. --preset ninja-debug-maximal \
  -DCMAKE_INSTALL_PREFIX=/tmp/local \
  -DARROW_CUDA=OFF \
  -DARROW_SKYHOOK=OFF \
  -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
  -DARROW_EXTRA_ERROR_CONTEXT=OFF
cmake --build .
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:42: error: 'codecvt_utf8<char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:97:14: note: in instantiation of function template specialization 'driver::odbcabstraction::Utf8ToWcs<char16_t>' requested here
   97 |       return Utf8ToWcs<char16_t>(utf8_string, length, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char16_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:21: error: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:86:44: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
   86 |   uint32_t length_in_bytes = string.size() * GetSqlWCharSize();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:42: error: 'codecvt_utf8<char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:99:14: note: in instantiation of function template specialization 'driver::odbcabstraction::Utf8ToWcs<char32_t>' requested here
   99 |       return Utf8ToWcs<char32_t>(utf8_string, length, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char32_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:21: error: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:86:44: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
   86 |   uint32_t length_in_bytes = string.size() * GetSqlWCharSize();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:42: error: 'codecvt_utf8<char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:129:14: note: in instantiation of function template specialization 'driver::odbcabstraction::WcsToUtf8<char16_t>' requested here
  129 |       return WcsToUtf8<char16_t>(wcs_string, length_in_code_units, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char16_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:21: error: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:118:42: error: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  118 |   uint32_t length_in_bytes = byte_string.size();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~^~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:42: error: 'codecvt_utf8<char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:131:14: note: in instantiation of function template specialization 'driver::odbcabstraction::WcsToUtf8<char32_t>' requested here
  131 |       return WcsToUtf8<char32_t>(wcs_string, length_in_code_units, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char32_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:21: error: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/encoding.cc:18:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:118:42: error: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  118 |   uint32_t length_in_bytes = byte_string.size();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~^~~~~~
12 errors generated.
[134/777] Building CXX object src/arro...ion.dir/odbc_impl/odbc_connection.cc.o
FAILED: src/arrow/flight/sql/odbc/odbcabstraction/CMakeFiles/odbcabstraction.dir/odbc_impl/odbc_connection.cc.o
/opt/homebrew/bin/ccache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DARROW_HAVE_NEON -DARROW_WITH_TIMING_TESTS -DFMT_HEADER_ONLY -DGRPC_ENABLE_ASYNC -DGRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS=grpc::experimental -DGRPC_USE_CERTIFICATE_VERIFIER -DGRPC_USE_TLS_CHANNEL_CREDENTIALS_OPTIONS -I/path/to/arrow/cpp/build/src -I/path/to/arrow/cpp/src -I/path/to/arrow/cpp/src/generated -I/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include -I/path/to/arrow/cpp/build/_deps/spdlog-src/include -isystem /opt/homebrew/include -fno-aligned-new  -Qunused-arguments -fcolor-diagnostics  -Wall -Wextra -Wdocumentation -DARROW_WARN_DOCUMENTATION -Wshorten-64-to-32 -Wno-missing-braces -Wno-unused-parameter -Wno-constant-logical-operand -Wno-return-stack-address -Wdate-time -Wno-unknown-warning-option -Wno-pass-failed -march=armv8-a  -g -Werror -O0 -ggdb  -std=c++17 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIC -MD -MT src/arrow/flight/sql/odbc/odbcabstraction/CMakeFiles/odbcabstraction.dir/odbc_impl/odbc_connection.cc.o -MF src/arrow/flight/sql/odbc/odbcabstraction/CMakeFiles/odbcabstraction.dir/odbc_impl/odbc_connection.cc.o.d -o src/arrow/flight/sql/odbc/odbcabstraction/CMakeFiles/odbcabstraction.dir/odbc_impl/odbc_connection.cc.o -c /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:42: error: 'codecvt_utf8<char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:97:14: note: in instantiation of function template specialization 'driver::odbcabstraction::Utf8ToWcs<char16_t>' requested here
   97 |       return Utf8ToWcs<char16_t>(utf8_string, length, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char16_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:21: error: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:86:44: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
   86 |   uint32_t length_in_bytes = string.size() * GetSqlWCharSize();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:42: error: 'codecvt_utf8<char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:99:14: note: in instantiation of function template specialization 'driver::odbcabstraction::Utf8ToWcs<char32_t>' requested here
   99 |       return Utf8ToWcs<char32_t>(utf8_string, length, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char32_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:83:21: error: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
   83 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:86:44: error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
   86 |   uint32_t length_in_bytes = string.size() * GetSqlWCharSize();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:42: error: 'codecvt_utf8<char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:129:14: note: in instantiation of function template specialization 'driver::odbcabstraction::WcsToUtf8<char16_t>' requested here
  129 |       return WcsToUtf8<char16_t>(wcs_string, length_in_code_units, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char16_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:21: error: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char16_t>, char16_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:118:42: error: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  118 |   uint32_t length_in_bytes = byte_string.size();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~^~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:42: error: 'codecvt_utf8<char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                                          ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:131:14: note: in instantiation of function template specialization 'driver::odbcabstraction::WcsToUtf8<char32_t>' requested here
  131 |       return WcsToUtf8<char32_t>(wcs_string, length_in_code_units, result);
      |              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/codecvt:194:28: note: 'codecvt_utf8<char32_t>' has been explicitly marked deprecated here
  194 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:114:21: error: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' is deprecated [-Werror,-Wdeprecated-declarations]
  114 |   thread_local std::wstring_convert<std::codecvt_utf8<CHAR_TYPE>, CHAR_TYPE> converter;
      |                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/locale:3114:28: note: 'wstring_convert<std::codecvt_utf8<char32_t>, char32_t>' has been explicitly marked deprecated here
 3114 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1022:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
 1022 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:995:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  995 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:29:
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/encoding_utils.h:20:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/encoding.h:118:42: error: implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  118 |   uint32_t length_in_bytes = byte_string.size();
      |            ~~~~~~~~~~~~~~~   ~~~~~~~~~~~~^~~~~~
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:90:28: error: comparison of integers of different signs: 'short' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
   90 |   if (output && outputSize < result + (isLengthInBytes ? GetSqlWCharSize() : 1)) {
      |                 ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:116:14: note: in instantiation of function template specialization 'ODBC::GetAttributeSQLWCHAR<short>' requested here
  116 |     result = GetAttributeSQLWCHAR(attributeValue, isLengthInBytes, output, outputSize,
      |              ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:164:7: note: in instantiation of function template specialization 'ODBC::GetStringAttribute<short>' requested here
  164 |       GetStringAttribute(isUnicode, m_dsn, true, value, bufferLength, outputLength,
      |       ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:61:28: error: comparison of integers of different signs: 'short' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
   61 |   if (output && outputSize < attributeValue.size() + 1) {
      |                 ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:119:14: note: in instantiation of function template specialization 'ODBC::GetAttributeUTF8<short>' requested here
  119 |     result = GetAttributeUTF8(attributeValue, output, outputSize, outputLenPtr);
      |              ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:164:7: note: in instantiation of function template specialization 'ODBC::GetStringAttribute<short>' requested here
  164 |       GetStringAttribute(isUnicode, m_dsn, true, value, bufferLength, outputLength,
      |       ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:90:28: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
   90 |   if (output && outputSize < result + (isLengthInBytes ? GetSqlWCharSize() : 1)) {
      |                 ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:116:14: note: in instantiation of function template specialization 'ODBC::GetAttributeSQLWCHAR<int>' requested here
  116 |     result = GetAttributeSQLWCHAR(attributeValue, isLengthInBytes, output, outputSize,
      |              ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:647:7: note: in instantiation of function template specialization 'ODBC::GetStringAttribute<int>' requested here
  647 |       GetStringAttribute(isUnicode, infoValue, true, value, bufferLength, outputLength,
      |       ^
In file included from /path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:21:
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:61:28: error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
   61 |   if (output && outputSize < attributeValue.size() + 1) {
      |                 ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/odbc_impl/attribute_utils.h:119:14: note: in instantiation of function template specialization 'ODBC::GetAttributeUTF8<int>' requested here
  119 |     result = GetAttributeUTF8(attributeValue, output, outputSize, outputLenPtr);
      |              ^
/path/to/arrow/cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_connection.cc:647:7: note: in instantiation of function template specialization 'ODBC::GetStringAttribute<int>' requested here
  647 |       GetStringAttribute(isUnicode, infoValue, true, value, bufferLength, outputLength,
      |       ^

Component(s)

C++

Activity

  1. changed the title [-][C++][Arrow Flight SQL ODBC] Build error with deprecated C++-17 feature[/-] [+][C++][FlightSQL][ODBC] Build error with deprecated C++-17 feature[/+] on May 24, 2025
  2. jduo commented on May 26, 2025

    @jduo
    Member

    @kou @lidavidm , do you know if there are existing instances of encoding conversions in the C++ codebase already (ie, is there another library already incorporated that can be used)?

    This work is a bit unplanned from the goal of building out the ODBC driver. It looks like this is a warning rather than an error -- can we suppress the deprecation warning in this header to start with, then submit a later PR to use an external unicode library?

    cc @alinaliBQ

  3. lidavidm commented on May 27, 2025

    @lidavidm
    Member

    It seems not. You would have to pull in utfcpp/ICU or wrangle something with wcstombs or use platform-specific APIs.

  4. kou commented on May 27, 2025

    @kou
    Member

    There is no encoding conversion feature in our codebase and C++ standard.
    We need to implement UTF-8 <-> UTF-16/UTF-32 conversions by ourselves (it's not difficult) or use external libraries. (Only Windows provides the API for them.)

    We can suppress it by surrounding codes that uses codecvt_utf8 by:

    #pragma GCC diagnostic push
    #pragma GCC diagnostic ignored "-Wdeprecated-declarations"

    and

    #pragma GCC diagnostic pop

    .

  5. alinaliBQ commented on May 28, 2025

    @alinaliBQ
    Collaborator

    @kou Thanks, I have submitted a PR to suppress the codecvt_utf8 deprecation warnings: #46622

  6. added a commit that references this issue on May 30, 2025
  7. kou commented on May 30, 2025

    @kou
    Member

    Issue resolved by pull request 46622
    #46622

  8. added this to the 21.0.0 milestone on May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions