Skip to content

[v3.4] C++17/C++26 deprecation/removal about wstring_convert and some codecvt impls #2335

@mandree

Description

@mandree

[EDIT/UPDATE: Fix slated for OpenEXR v4.0.0 as per #2314 that requires API change, hence not doable in v3.4 context]

C++17 deprecated and C++26 removed wstring_convert; this is with commit 8de91e6, just before v3.4.9, and related to #1785 - this happens on Fedora Linux 42 fully patched, which runs GCC 15.2.1.

[34+132/310  42%| 28% 15.8/19.7 00:17] Building CXX object src/lib/OpenEXR/CMakeFiles/OpenEXR.dir/ImfMisc.cpp.o
/home/mandree/VCS-other/openexr.git/src/lib/OpenEXR/ImfMisc.cpp: In function ‘std::wstring Imf_4_0::WidenFilename(const char*)’:
/home/mandree/VCS-other/openexr.git/src/lib/OpenEXR/ImfMisc.cpp:2002:10: warning: ‘template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> class std::__cxx11::wstring_convert’ is deprecated [-Wdeprecated-declarations]
 2002 |     std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
      |          ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/15/locale:47,
                 from /home/mandree/VCS-other/openexr.git/src/lib/OpenEXR/ImfMisc.cpp:27:
/usr/include/c++/15/bits/locale_conv.h:262:33: note: declared here
  262 |     class _GLIBCXX17_DEPRECATED wstring_convert
      |                                 ^~~~~~~~~~~~~~~
[1+310/310 100%|100% 14.7/15.2 00:00] Linking CXX executable bin/IexTest

Just like #1785 this needs a replacement outside the C++ standard.

Depending on how much time the OpenEXR developers can afford to spend, this is a loose unordered collection of relevant links I came across:

This is the relevant FreeBSD 15.0-RELEASE warning set when building 3.4.9-rc:

[131/310] Building CXX object src/lib/OpenEXR/CMakeFiles/OpenEXR.dir/ImfMisc.cpp.o
/home/mandree/VCS-other/openexr.git/src/lib/OpenEXR/ImfMisc.cpp:2002:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
 2002 |     std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
      |                               ^
/usr/include/c++/v1/codecvt:193:28: note: 'codecvt_utf8<wchar_t>' has been explicitly marked deprecated here
  193 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 codecvt_utf8 : public __codecvt_utf8<_Elem> {
      |                            ^
/usr/include/c++/v1/__config:748:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  748 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/usr/include/c++/v1/__config:713:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  713 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
/home/mandree/VCS-other/openexr.git/src/lib/OpenEXR/ImfMisc.cpp:2002:10: warning: 'wstring_convert<std::codecvt_utf8<wchar_t>>' is deprecated [-Wdeprecated-declarations]
 2002 |     std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> converter;
      |          ^
/usr/include/c++/v1/locale:3145:28: note: 'wstring_convert<std::codecvt_utf8<wchar_t>>' has been explicitly marked deprecated here
 3145 | class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 wstring_convert {
      |                            ^
/usr/include/c++/v1/__config:748:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
  748 | #    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
      |                                         ^
/usr/include/c++/v1/__config:713:49: note: expanded from macro '_LIBCPP_DEPRECATED'
  713 | #      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
      |                                                 ^
2 warnings generated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions