[Bug c/28912] Non-functional -funsigned-char: signed/unsigned mismatch is reported

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Sep 21 21:24:00 GMT 2006



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-09-21 21:24 -------
(In reply to comment #4)
> I accepts Andrew's point, but note that you will get errors, not warnings, for
> identical C++ code.

Right, this is still invalid code in both C and C++, just in the C front-end we
decided to warn by default instead of error out.  You can get an error with the
C front-end by doing -pednatic-errors

> The problem is exacerbate by libc prototypes such as size_t strlen(const char
> *s).

Because that is what the C (and C++) standard defines the prototypes as.

As I mentioned your code is invalid according to the C (and C++) standard
so warning is the correct thing to do.

I would think you should not care about the signedness of char really.

The agrument about UTF-8 is really bogus as you can do:
unsigned char a = *b;
where b is a pointer to char and get the correct result.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28912



More information about the Gcc-bugs mailing list