nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ralph Corderoy
Subject: Re: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again
Date: Tue, 05 Feb 2013 16:44:15 +0000

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]