<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] warning cleared



On 2005-09-20 08:19:31 -0500, David Champion wrote:
> * On 2005.09.20, in <20050920081219.GB10503@xxxxxxxxxxxxx>,
> *     "Vincent Lefevre" <vincent@xxxxxxxxxx> wrote:
> > to an unsigned char or EOF. You need to cast to an unsigned char
> > first (you can then cast to an int, but this is useless, and the
> > compiler shouldn't complain):
> 
> As you like.  I wrote the code being patched, and happen to know that
> casting to int is a correct solution. :)

If the string can contain a non-ASCII character, then it isn't correct
and would lead to an undefined behavior on machines with signed chars.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA