bitcoin icon indicating copy to clipboard operation
bitcoin copied to clipboard

fs: suppress u8path deprecated-declaration warnings with libc++

Open fanquake opened this issue 2 years ago • 0 comments

When building in c++20 mode using libc++, the following warning is emitted:

./fs.h:72:29: warning: 'u8path<std::string>' is deprecated [-Wdeprecated-declarations]
    return std::filesystem::u8path(utf8_str);
                            ^
/usr/lib/llvm-14/bin/../include/c++/v1/__filesystem/u8path.h:72:27: note: 'u8path<std::string>' has been explicitly marked deprecated here
_LIBCPP_INLINE_VISIBILITY _LIBCPP_DEPRECATED_WITH_CHAR8_T
                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1042:43: note: expanded from macro '_LIBCPP_DEPRECATED_WITH_CHAR8_T'
                                          ^
/usr/lib/llvm-14/bin/../include/c++/v1/__config:1007:48: note: expanded from macro '_LIBCPP_DEPRECATED'
                                               ^
1 warning generated.

as u8path<std::string> is deprecated starting with C++20.

Seems easiest to just suppress this, as it's a single func, and the only warning I've seen compiling under C++20. We use #pramga to do similar in a few other parts of the codebase.

Fixes: #24682.

fanquake avatar Aug 09 '22 08:08 fanquake