[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doesn't this look incorrect?
From: |
Eli Zaretskii |
Subject: |
Re: doesn't this look incorrect? |
Date: |
Mon, 28 Nov 2022 14:19:45 +0200 |
> Date: Mon, 28 Nov 2022 06:30:22 +0100
> From: <tomas@tuxteam.de>
>
> > > static int isdead = 0;
> > >
> > > if (isdead == 2)
> > >
> > > This is apparently a mistake.
> >
> > I don't think so. See what `static' means for a variable declaration
> > inside a function.
>
> Still it seems to me that Christopher has a point: the `if' doesn't
> seem reachable from any other path, so `isdead' will be always zero
> at that point?
It will be "reachable" by the next call to this function. The code below
the 'if' updates the variable, in several places.