Re: [PATCH 2/2] http.c: avoid gcc warning
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 6, 2022, 20:22 UTC
- Message-ID
- <xmqqtua2jtr0.fsf@gitster.g>
- In-Reply-To
- <3f0e462e86625a3c253653e4a4eefabcd8590bf9.1651859773.git.git@grubix.eu>
Michael J Gruber <git@grubix.eu> writes:
See previous discussion on the topic and help clarify it for me, thanks.
https://lore.kernel.org/git/xmqqo8131tr8.fsf@gitster.g/
Show 24 quoted lines
> Related to -Wdangling-pointer. > > In fact, this use of the pointer looks scary and has not created > problems so far only because the pointer in the struct is not used when > execution is out of the scope of the local function (and the pointer > invalid). > > Signed-off-by: Michael J Gruber <git@grubix.eu> > --- > http.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/http.c b/http.c > index 229da4d148..2f67fbb33c 100644 > --- a/http.c > +++ b/http.c > @@ -1367,6 +1367,7 @@ void run_active_slot(struct active_request_slot *slot) > select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout); > } > } > + slot->finished = NULL; > } > > static void release_active_slot(struct active_request_slot *slot)