All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: git@vger.kernel.org, phillip.wood@talktalk.net, avarab@gmail.com
Subject: Re: [PATCH 2/2] config.mak.dev: alternative workaround to gcc 12 warning in http.c
Date: Fri, 15 Apr 2022 16:34:03 -0700	[thread overview]
Message-ID: <xmqqh76taplg.fsf@gitster.g> (raw)
In-Reply-To: <20220415231342.35980-3-carenas@gmail.com> ("Carlo Marcelo Arenas =?utf-8?Q?Bel=C3=B3n=22's?= message of "Fri, 15 Apr 2022 16:13:42 -0700")

Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:

> This provides a "no code change needed" option to the "fix" currently
> queued as part of ab/http-gcc-12-workaround and therefore should be
> reverted once that gets merged.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  config.mak.dev | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/config.mak.dev b/config.mak.dev
> index 335efd46203..c3104f400b2 100644
> --- a/config.mak.dev
> +++ b/config.mak.dev
> @@ -68,6 +68,7 @@ endif
>  # https://bugzilla.redhat.com/show_bug.cgi?id=2075786
>  ifneq ($(filter gcc12,$(COMPILER_FEATURES)),)
>  DEVELOPER_CFLAGS += -Wno-error=stringop-overread
> +DEVELOPER_CFLAGS += -Wno-error=dangling-pointer
>  endif
>  
>  GIT_TEST_PERL_FATAL_WARNINGS = YesPlease

Hmph, this might be an acceptable workaround to squelch the compiler
that complains "you stored an onstack pointer in a structure and
then you are leaving the scope".  We should do something more like
the attached patch, with or without the gcc warning, I think.  We
may have smuggled the pointer to finished in slot->finished pointer
that survives the current stackframe out of the function in the
original code, so that is what we rectify by clearing the member
when it has the value we stored.


 http.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git c/http.c w/http.c
index 229da4d148..85437b1980 100644
--- c/http.c
+++ w/http.c
@@ -1367,6 +1367,9 @@ void run_active_slot(struct active_request_slot *slot)
 			select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
 		}
 	}
+
+	if (slot->finished == &finished)
+		slot->finished = NULL;
 }
 
 static void release_active_slot(struct active_request_slot *slot)

  reply	other threads:[~2022-04-15 23:34 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 12:39 [PATCH] ci: lock "pedantic" job into fedora 35 and other cleanup Carlo Marcelo Arenas Belón
2022-04-15 13:17 ` Ævar Arnfjörð Bjarmason
2022-04-15 13:50 ` Phillip Wood
2022-04-15 18:31 ` Junio C Hamano
2022-04-15 21:03   ` Carlo Arenas
2022-04-15 22:20     ` Junio C Hamano
2022-04-15 23:13 ` [PATCH 0/2] ci: avoid failures for pedantic job with fedora 36 Carlo Marcelo Arenas Belón
2022-04-15 23:13   ` [PATCH 1/2] config.mak.dev: workaround gcc 12 bug affecting "pedantic" CI job Carlo Marcelo Arenas Belón
2022-04-15 23:41     ` Ævar Arnfjörð Bjarmason
2022-04-16  0:08       ` Carlo Arenas
2022-04-16  0:55         ` Ævar Arnfjörð Bjarmason
2022-04-16  5:56           ` Junio C Hamano
2022-04-16 12:33             ` Ævar Arnfjörð Bjarmason
2022-04-16  0:19       ` Junio C Hamano
2022-04-15 23:56     ` Junio C Hamano
2022-04-15 23:13   ` [PATCH 2/2] config.mak.dev: alternative workaround to gcc 12 warning in http.c Carlo Marcelo Arenas Belón
2022-04-15 23:34     ` Junio C Hamano [this message]
2022-04-16  0:02       ` Carlo Arenas
2022-04-16  0:28         ` Junio C Hamano
2022-04-16  0:51           ` Carlo Arenas
2022-04-16  1:00           ` Junio C Hamano
2022-04-16 12:50             ` Ævar Arnfjörð Bjarmason
2022-04-16  1:20           ` Ævar Arnfjörð Bjarmason
2022-04-16 14:23             ` Junio C Hamano
2022-04-16  1:08         ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh76taplg.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood@talktalk.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.