Closed guillaume-michel closed 5 years ago
Hi Michel. The honest answer is: I don't know but 99.9999% sure it is fine. ... And so far no one from LLVM side complained on the incorrect results... I don't work with LLVM compiler and the ones I use accept this value without conversion. The truth is -these functions are sign unaware. So unsigned char (and that's what 128 is actually) works fine for them - it should be 0x80 ie only the first bit in a char set to 1. So if you check it in any debugger and report -I'd appreciate it.
in C, value like 128 is definitely an int (signed integer). When given to function that expects char, it is casted to char -128 by the compiler which is 0x80. So if it is the value you expect, it is fine and you can close the issue. Thanks for your reply.
Replacing 128 with 0x80 avoids the warning.
While compiling with clang I get this warning:
official function signature:
and (signed) char range is [-128; 127].
I understand why clang complains but I don't know if it is a problem or not.
Can you please clarify the issue for me?
Best regards.