Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

New Post: Android-specific JSON parse failure

$
0
0
Thanks for the quick answer -- we’re building via Clang3.4 (android-17, C++11) and were able to get it working by using the -fsigned-char compiler switch. Unfortunately Clang defaults to using an unsigned char type for ARM. This affects the EOF checking code in Casablanca, e.g. json_parsing.cpp line 308:

const typename std::char_traits<CharType>::int_type m_eof;

template <typename CharType>
CharType JSON_Parser<CharType>::EatWhitespace()
{
CharType ch = NextCharacter();

while ( ch != this->m_eof && iswspace((int)ch) )


That is, m_eof contains -1 as it’s an integer type that can hold all values of char_type plus EOF. However, ch in the code above isn’t the same type and winds up with 255 != -1.

Viewing all articles
Browse latest Browse all 4845


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>