[PATCH] Xi: make the scope of len match its lifetime.

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 10 17:38:47 PST 2009


On Thu, Dec 10, 2009 at 03:46:48AM +0100, Tomas Carnecky wrote:
> On 12/10/09 3:16 AM, Jamey Sharp wrote:
> >The clang static analyzer gets confused by reusing the same variable.
> >
> >Reported-by: Tomas Carnecky<tom at dbservice.com>
> >Signed-off-by: Jamey Sharp<jamey at minilop.net>
> >---
> >
> >What do you think of this patch in place of the "set len to zero to
> >avoid confusing clang" patch? Does this also make clang happy? Am I the
> >only one who'd prefer this approach over introducing a useless
> >initialization? :-)
> 
> Actually, that one looks like a bug in clang. I mean, 'len' is
> clearly being assigned a value just before it's used. And I wouldn't
> want you to change code just to work around bugs in clang.

we've got minor code changes in to avoid noise in valgrind, so it's not an
issue per-se. i agree that this is a rather glaringly obvious bug in clang
though, so I'll leave the patch (both mine and Jamey's) out for now.

Cheers,
  Peter


More information about the xorg-devel mailing list