Reading a char from the file
geekskick opened this issue · 2 comments
geekskick commented
Using a file containing:
v = 25500
and extracting that using
const char a = init[""]["v"] | 'a';
I would expect that '25500' is out of range, so the fall back is used, but it isn't and the value 0x639c is used instead. This can be seen in #5 on line 292 and 291.
Qix- commented
Could you make sure warnings are high? There is no officially supported char
or unsigned char
overload - this is most likely coercing 'a'
to an integer, and then converting the int
back down to a char
size. MSVC (assuming you're using MSVC from your PR with .vscode) should be outputting a warning about this.
In theory, shorts/chars could be supported, it'd just be a matter of bounds checking.
geekskick commented
My mistake I should have RTFM. I’ll remove the tests and close this issue.