[cfe-dev] clang not observing -fno-signed-char, and other triple realted issues

Javier Múgica via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 4 09:48:58 PST 2020


Your answer is very good. Thank you very much for it. You have made me clear what I was doubtful or ignorant about better than I could have expected.

1. Regarding -funsigned-char.

A minimum example also works for me, but I am sure I got those warnings, so I wet through it and here is a different kind of minimum example:

typedef unsigned char char8_t;

int func(const char8_t *s){return 0;}
int main(void){	
	char8_t *s="Some text"; //-Wpointer-sign
	return func("Some text"); //-Wpointer-sign

As you can see, the bug is restricted to the type Clang assigns to string literals. Curiously, now I have not been able to set the compilation flags in such a way that the warning does not show up, the --target does not seem to have any effect, but when I compile my code in Linux the warnings do not appear (and they have not been turned off).

3. " Making objects static ..." .

Yes, I know, I made them static on the purpose.

4. "fms-compatibility is the set of compatibility hacks that we would prefer to avoid"

You could not have explained it better. Fortunately, I turns out that I don't need those hacks for my code to compile, whatever they be.


-- Javier A. Múgica

More information about the cfe-dev mailing list