nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again

2013-02-05 10:44:33
Hi Ken,

I haven't tried it but I don't think having gcc use unsigned chars
will silence it;  it's warning about the potential problem
regardless of whether you've optioned it away this time.

According to the gcc man page on my system, under -funsigned-char:

    The type "char" is always a distinct type from each of "signed
    char" or "unsigned char", even though its behavior is always just
    like one of those two.

So since the prototype for functions like strcpy() and the like are
"char", in theory this would suppress the warnings.

No, I mean that gcc is highlighting a bit of lint and pointing out that
passing a char to ctype is non-portable and may bite elsewhere, even if
the current platform's native char is unsigned, e.g. ARM.  Altering char
to be unsigned doesn't stop it trying to be helpful AIUI.

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>