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: David Levine
Subject: Re: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again
Date: Tue, 05 Feb 2013 14:17:12 -0500

> >It would solve the warning, but not the bug in the code, which is
> >the missing explicit cast to int required to match the is* function
> >prototype.
> 
> Is that required?  Won't the prototypes for the is* functions take
> care of it?

No and yes.  Cast of any char flavor to an int is not
required because a char can be promoted to an int.  The
problem is sign extension when a signed char is promoted to
an int.  Combined with char being able to be signed.
Compounded by char being able to not be signed, so the
compiler might not always notice.

David



reply via email to

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