Getting a sign-conversion warning/error with clang 14 and CXXOPTS_USE_UNICODE_HELP ON
tanja84dk opened this issue · comments
Just wanna inform that I'm receiving a sign-conversion warning/error about when ever I build with CXXOPTS_USE_UNICODE_HELP ON on clang 14
It gives no warnings as soon as I don't build with the CXXOPTS_USE_UNICODE_HELP OFF
The version I'm using is the 3.1.1 from releases.
compiled with "-g -Werror -Wall -Wextra -pedantic -Wconversion -Wundef -Wshadow -Wno-gnu-zero-variadic-macro-arguments -Wzero-as-null-pointer-constant -std=gnu++20"
It looks like its because legth actually is returning a int32_t and not size_t so it looks like change from signed to unsigned within the defined CXXOPTS_USE_UNICODE in the std::size_t stringLength function.
[build] /home/buildclient/.cache/CPM/cxxopts/34ea97fde3ca260fa6ad09943fe241d2af50025c/cxxopts/include/cxxopts.hpp:236:12: error: implicit conversion changes signedness: 'int32_t' (aka 'int') to 'std::size_t' (aka 'unsigned long') [-Werror,-Wsign-conversion]
[build] return s.length();
[build] ~~~~~~ ~~^~~~~~~~
[build] 1 error generated.
Thanks, I'll take a look at that one.