tech-userlevel archive

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

Re: using the interfaces in ctype.h



On Mon, Apr 21, 2008 at 01:36:33PM -0400, Greg A. Woods; Planix, Inc. wrote:
> Huh?  In NetBSD both (_ctype_+1)[-1]==0 and (_ctype_+1)[0xff]==0 so what's 
> to be distinguished?!?!?!?

Depending on LC_CTYPE it is. E.g. for latin1 255 is "LATIN SMALL LETTER
Y WITH DIAERESIS", so e.g. islower would be true.

> Furthermore how's that any different than suggesting that the caller cast 
> the parameter with "(unsigned char)" or "(int)(unsigned char)"?  The cast 
> still causes the passed value to be effectively masked with 0xFF and so 
> even if the implementation did want to distinguish a character of 0xFF from 
> the value of EOF it could not.

The caller can know if EOF is valid at that moment or not.

Joerg


Home | Main Index | Thread Index | Old Index