On Fri, 8 Jan 2016, Martin Sebor wrote: > > I don't think it's desirable to raise the warning for this case under > > different conditions from the warning for other signedness cases. The > > targets do differ in signedness - it's just that the difference is between > > "plain" and "signed" or "plain" and "unsigned", not between signed and > > unsigned. > > I'm sorry Joseph but I don't quite follow this argument. Plain > char is neither a signed [integer] type nor an unsigned [integer] > type, so it can never differ in signedness from any other type.
Signedness of char (and of bit-fields) is a tristate, "signed", "unsigned" and "". My claim is that a difference between any two of those three values is essentially the same kind of difference. And so at most the wording should be adjusted (or maybe an inform ("%<char%> and %<signed char%> are different types" added), not the conditions for some such warning to be given. > It seems to me that by the interpretation you suggest, converting > a signed int* to unsigned long* should be controlled by -Wpointer- > sign when int and long have the same representation, and by > -Wincompatible-pointer-types otherwise. (Which is not what GCC > does.) No, because those differ between "int" and "long", not between "signed" and "" or "unsigned" and "" as signedness. -- Joseph S. Myers jos...@codesourcery.com