I'm having trouble understanding why clang presents the error message
character too large for enclosing character literal type
when trying to run the code:
char c = 'ç';
While Visual Studio 2015 compiles seamlessly. I know that different compilers can and do have their different implementations. And that ç is outside of the ASCII table, that the numeric value must be greater than 127 so Clang informs that it can not store within type char
. But I would still like to know:
Why does not Clang allow me to use 'ç' as a char while Visual Studio allows? Is something predefined in Visual Studio? Any option based on my system language?
Why does Visual Studio return the "correct" value in string
functions, as strlen
even passing strings with accents?
Example: strlen("opção");
Returns 5 in Visual Studio, I expected the return to be 7 as Clang returns.