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: Paul Vixie
Subject: Re: [Nmh-workers] Compiler warnings and signed vs. unsigned char, again
Date: Tue, 05 Feb 2013 11:33:18 -0800
User-agent: Postbox 3.0.7 (Windows/20130120)



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?


reply via email to

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