From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
Junio C Hamano <gitster@pobox.com>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH] name-rev: fix an 'may be used uninitialized' error
Date: Tue, 5 May 2026 01:41:45 +0100 [thread overview]
Message-ID: <aad833e9-d34e-4e57-a1e7-99dc0c6c7d24@ramsayjones.plus.com> (raw)
In-Reply-To: <cccf9618-31de-447b-ab17-4fb8cee23363@app.fastmail.com>
On 04/05/2026 10:56 pm, Kristoffer Haugsbakk wrote:
> On Mon, May 4, 2026, at 22:26, Ramsay Jones wrote:
>> On 04/05/2026 2:13 am, Junio C Hamano wrote:
>>> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
>>>> [snip]
>>
>> Having now spent some time (well at least 30 seconds :) ) looking at the
>> surrounding code, then your final suggestion looks really good to me! ;)
>>
>> However, these 'maybe-uninitialized' errors (historically have been) somewhat
>> sensitive to the level of optimization used in the compilation and even algo
>> used by the compiler changing frequently from one version to the next ...
>> So, I wasn't sure if Kristoffer was actually seeing the error or had the
>> DEVELOPER variable set (which is why I mentioned it in passing!).
>
> This is what I had when maybe-uninit. didn’t fail for me.
>
> $ cat config.mak
> DEVELOPER=1
> DEBUG=1
> CC = ccache gcc
> CFLAGS+=-O0
Ah, yes -O0 will disable the warning/error. Normally CFLAGS would be set to
something like 'CFLAGS = -g -O2 -Wall'. (which still produces a binary you
can reasonably use with gdb).
> CFLAGS+=-ggdb3
> USE_ASCIIDOCTOR=true
>
> I switched to the whole config.mak.dev enchilada and now it fails
> as it should.
>
next prev parent reply other threads:[~2026-05-05 0:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 15:16 [PATCH] name-rev: fix an 'may be used uninitialized' error Ramsay Jones
2026-05-03 18:52 ` Kristoffer Haugsbakk
2026-05-04 1:13 ` Junio C Hamano
2026-05-04 8:55 ` Kristoffer Haugsbakk
2026-05-04 20:26 ` Ramsay Jones
2026-05-04 21:56 ` Kristoffer Haugsbakk
2026-05-05 0:41 ` Ramsay Jones [this message]
2026-05-05 19:09 ` Kristoffer Haugsbakk
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=aad833e9-d34e-4e57-a1e7-99dc0c6c7d24@ramsayjones.plus.com \
--to=ramsay@ramsayjones.plus.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kristofferhaugsbakk@fastmail.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