Subject: Re: [PATCH] http.c: clear the 'finished' member once we are done with it

From: Junio C Hamano <[email-masked]>
Date: Tue, 24 May 2022 15:34:40 -0700

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

> It doesn't mean that GCC has additionally proved that we'll later used
> it in a way that will have a meaningful impact on the behavior of our
> program, or even that it's tried to do that. See an excerpt from the GCC
> code (a comment) in [1].

But that means the warning just as irrelevant as "you stored 438 to
this integer variable".  Sure, there may be cases where that integer
variable should not exceed 400 and if the compiler can tell us that,
that would be a valuable help to developers.  But "you stored an
address of an object that can go out of scope in another object
whose lifetime lasts beyond the scope" alone is not, without "and
the caller that passed the latter object later dereferences that
address here".  We certainly shouldn't -Werror on such a warning
and bend our code because of it.