Source-Changes archive

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

Re: CVS commit: src/lib



David Laight wrote:
> > >Fix a load of international alphabet problems with isxxx() and toupper()
> > >Change isspace(*char_ptr) to isspace(*char_ptr & 0xff) so that the correct
> > >piece of memory is looked at for the bit mask.
> > >gcc optimises out the '& 0xff' (on i386 at least).
> > >Fixes problems found by gcc when the splurious (int) cast is removed
> > 
> > Why didn't you cast to (unsigned char) as is the current practice everywhere
> > else in the code?!?
> 
> Because I want the compiler to check that the argument is an integral value.
> In particular isdigit((unsigned char)cp) is a likely typo...

That's why compiler emits:

foo.c:x: warning: cast from pointer to integer of different size

for this case.

Please change those to use cast via (unsigned char), since _that_
is the correct form.

Jaromir 
-- 
Jaromir Dolecek <jdolecek%NetBSD.org@localhost>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
-=- sometimes levitate or glow.   Do not let this distract you.''   -=-



Home | Main Index | Thread Index | Old Index