Subject: Re: CVS commit: src/common/lib/libc/string
To: Martin Husemann <martin@duskware.de>
From: Alan Barrett <apb@cequrux.com>
List: source-changes
Date: 01/09/2008 16:42:10
On Wed, 09 Jan 2008, Martin Husemann wrote:
> On Wed, Jan 09, 2008 at 09:59:27AM +0200, Alan Barrett wrote:
> > Wouldn't casts have had the same effect? e.g.:
> >
> > if (*p == (unsigned char)c) ...
>
> Probably - any reason you'd prefer it? I suppose there will not be any
> difference in the generated code (but did not actually try).
I'd expect the generated code to be the same, but haven't checked. I
prefer the cast because I think it's less likely that somebody will come
along later and think "this variable looks useless, let's remove it".
--apb (Alan Barrett)