git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Calvin Wan <calvinwan@google.com>
Cc: git@vger.kernel.org,  steamdon@google.com,  emrass@google.com,
	ps@pks.im,  me@ttaylorr.com,  stolee@gmail.com
Subject: Re: [RFC PATCH 1/1] maintenance: separate parallelism safe and unsafe tasks
Date: Mon, 11 Nov 2024 17:24:59 +0900	[thread overview]
Message-ID: <xmqq1pzich44.fsf@gitster.g> (raw)
In-Reply-To: <20241108173112.1240584-2-calvinwan@google.com> (Calvin Wan's message of "Fri, 8 Nov 2024 17:31:12 +0000")

Calvin Wan <calvinwan@google.com> writes:

> +	for (j = j; j < TASK__COUNT; j++) {

This seems to break the build.
Here is what I got from my compiler.

builtin/gc.c:1588:9: error: explicitly assigning value of variable of type 'int' to itself [-Werror,-Wself-assign]
        for (j = j; j < TASK__COUNT; j++) {
             ~ ^ ~
builtin/gc.c:1535:11: error: variable 'j' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        else if (opts->detach > 0) {
                 ^~~~~~~~~~~~~~~~
builtin/gc.c:1588:11: note: uninitialized use occurs here
        for (j = j; j < TASK__COUNT; j++) {
                 ^
builtin/gc.c:1535:7: note: remove the 'if' if its condition is always true
        else if (opts->detach > 0) {
             ^~~~~~~~~~~~~~~~~~~~~~
builtin/gc.c:1533:6: error: variable 'j' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
        if (found_selected)
            ^~~~~~~~~~~~~~
builtin/gc.c:1588:11: note: uninitialized use occurs here
        for (j = j; j < TASK__COUNT; j++) {
                 ^
builtin/gc.c:1533:2: note: remove the 'if' if its condition is always false
        if (found_selected)
        ^~~~~~~~~~~~~~~~~~~
builtin/gc.c:1508:10: note: initialize the variable 'j' to silence this warning
        int i, j, found_selected = 0;
                ^
                 = 0


  parent reply	other threads:[~2024-11-11  8:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 17:31 [RFC PATCH 0/1] maintenance: separate parallelism safe and unsafe tasks Calvin Wan
2024-11-08 17:31 ` [RFC PATCH 1/1] " Calvin Wan
2024-11-11  7:07   ` Patrick Steinhardt
2024-11-11 18:06     ` Calvin Wan
2024-11-12  6:28       ` Patrick Steinhardt
2024-11-15 20:13         ` Calvin Wan
2024-11-18  1:32           ` Junio C Hamano
2024-11-18  6:58           ` Patrick Steinhardt
2024-11-11  8:24   ` Junio C Hamano [this message]
2024-11-11  9:14   ` Junio C Hamano
2024-11-11 18:12     ` Calvin Wan
2024-11-11  4:50 ` [RFC PATCH 0/1] " Junio C Hamano
2024-11-11 18:39   ` Calvin Wan

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=xmqq1pzich44.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=calvinwan@google.com \
    --cc=emrass@google.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=ps@pks.im \
    --cc=steamdon@google.com \
    --cc=stolee@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).