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

>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);

--Ken



reply via email to

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