Skip to content

Conversation

hannes
Copy link
Member

@hannes hannes commented Feb 17, 2023

FMT used unsigned char as an internal type to represent single-byte characters. But it does not seem to matter and clang16 does not like the unsigned version:
duckdb/third_party/fmt/include/fmt/core.h:295:30: warning: 'char_traits<unsigned char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]

From the spec:
https://en.cppreference.com/w/cpp/language/types

char - type for character representation which can be most efficiently processed on the target system (has the same representation and alignment as either signed char or unsigned char, but is always a distinct type). Multibyte characters strings use this type to represent code units. For every value of type unsigned char in range [0, 255], converting the value to char and then back to unsigned char produces the original value. (since C++11) The signedness of char depends on the compiler and the target platform: the defaults for ARM and PowerPC are typically unsigned, the defaults for x86 and x64 are typically signed.

@Mytherin Mytherin merged commit 61ac8b9 into duckdb:master Feb 17, 2023
@hannes hannes deleted the fmtucharchar branch March 1, 2023 10:03
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