File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,9 @@ namespace vx::string_utils {
241241 std::size_t size = _size;
242242 if ( !size ) {
243243
244+ #if defined __linux__ && defined __clang__ && __clang_major__ >= 18
245+ size = std::strlen ( reinterpret_cast <const char *>( _uchr ) );
246+ #else
244247 std::basic_string<unsigned char > string {};
245248 try {
246249
@@ -250,10 +253,11 @@ namespace vx::string_utils {
250253
251254 logFatal () << _exception.what ();
252255 }
253- #ifdef _WIN32
256+ #ifdef _WIN32
254257 size = std::strnlen_s ( reinterpret_cast <const char *>( _uchr ), string.size () ); // NOSONAR do not use reinterpret_cast.
255- #else
258+ #else
256259 size = std::strnlen ( reinterpret_cast <const char *>( _uchr ), string.size () ); // NOSONAR do not use reinterpret_cast.
260+ #endif
257261#endif
258262 }
259263 return std::make_optional<std::string>( _uchr, _uchr + size ); // NOSONAR do not use pointer arithmetic.
You can’t perform that action at this time.
0 commit comments