Question

I have to compile a large c++ library using clang. The library assumes that "char" is signed. Is there any way to tell it to the clang compiler? For this compiler, char is signed on x86, but it is unsigned on an arm target.

gcc has both options to make char signed or unsigned. For clang, I only found the /J switch which works the opposite way than it is needed in this case.

Was it helpful?

Solution

The -fsigned-char switch appears to be what you're after. I don't have an ARM machine to try it on, but at least x86 clang accepts it without complaining.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top