tgockel / json-voorhees

A killer modern C++ library for interacting with JSON.
http://tgockel.github.io/json-voorhees/
Apache License 2.0
128 stars 18 forks source link

Remove use of variable-length array in character conversion #127

Closed tgockel closed 5 years ago

tgockel commented 5 years ago

The character conversion code relies on the use of a variable-length array, which causes modern compilers to emit this warning:

/root/jsonv/src/jsonv/char_convert.cpp: In function 'std::__cxx11::wstring jsonv::detail::convert_to_wide(jsonv::detail::string_view)':
/root/jsonv/src/jsonv/char_convert.cpp:583:43: warning: ISO C++ forbids variable length array 'unicode_buff' [-Wvla]
     char32_t    unicode_buff[source.size()];
                                           ^

This is kind of annoying.