[Top][All Lists]

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

Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes

From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] WIP PATCH: clang static analyzer and warning fixes
Date: Thu, 19 Jun 2014 09:49:57 -0400

Indeed, the loop body is exited and reentered in each iteration so the scope is lost each time. It is only thanks to the reuse of stack that the code worked. The last fix by Werner is correct. I would initialize to -1 though for consistency or not initialize at all.

On Thu, Jun 19, 2014 at 12:40 AM, Werner LEMBERG <address@hidden> wrote:

> I'm fairly confident that the value of "a" is undefined at the start
> of every iteration of the loop.  Ie. it's not guaranteed to be
> retained.  As such, if there's any iteration that you do NOT assign
> a value to it, it's undefined.  I'm researching this more.

Ah, interesting!  Yes, please do, since this is an important aspect of
the C language.


Alexei A. Podtelezhnikov, PhD

reply via email to

[Prev in Thread] Current Thread [Next in Thread]