Skip to content

fix: suppress char_traits<uint8_t> deprecation for Xcode 26+ / libc++ 16+#4

Open
pgarciagon wants to merge 1 commit intokoinos:masterfrom
pgarciagon:fix/macos-libcxx26-char-traits
Open

fix: suppress char_traits<uint8_t> deprecation for Xcode 26+ / libc++ 16+#4
pgarciagon wants to merge 1 commit intokoinos:masterfrom
pgarciagon:fix/macos-libcxx26-char-traits

Conversation

@pgarciagon
Copy link
Copy Markdown

Problem

std::basic_string<uint8_t> and std::basic_string_view<uint8_t> instantiate
std::char_traits<unsigned char>. Starting with LLVM libc++ 16 that specialisation
is marked deprecated; in Xcode 26 (libc++ 26 beta) it is a hard error:

lib/fizzy/bytes.hpp:13:38: error: 'char_traits<unsigned char>' is deprecated
    [-Werror,-Wdeprecated-declarations]

This blocks building any project that depends on fizzy via CMake/Hunter on
Apple Silicon Macs with Xcode 26.

Fix

Wrap the two type aliases in bytes.hpp with #pragma clang diagnostic guards
that suppress -Wdeprecated-declarations locally. No functional change; only
the diagnostic suppression is added. Non-Clang compilers are unaffected.

Testing

Built and linked against koinos-chain on macOS 15 / Apple M-series / Xcode 16.3
(Xcode 26 beta). All existing tests pass.

std::basic_string<uint8_t> and std::basic_string_view<uint8_t> instantiate
char_traits<unsigned char>, which libc++ 16+ marks as deprecated (error with
-Werror on Xcode 26 / macOS Sequoia+).

Add #pragma clang diagnostic to suppress the warning around the fizzy
namespace typedefs. A long-term fix would replace bytes/bytes_view with
std::span<uint8_t>, but that requires broader API changes.

Fixes build on: Apple Clang 17+ (Xcode 26+), LLVM Clang 16+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants