nmh-workers
[Top] [All Lists]

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

2013-02-05 13:34:13


Ken Hornstein wrote:
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.

Right, but I was thinking we'd be doing:

      isdigit((unsigned char) c);

Which, AFAIK, is correct.

Some people advocated (and I thought that's what Lyndon was talking about):

      isdigit((int)(unsigned char) c);

doesn't ansi c require the isdigit implementation to do that?

_______________________________________________
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>