Re: [PATCH 09/19] object-file: make `buf` parameter of `index_mem()` a constant
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 29, 2024, 20:01 UTC
- Message-ID
- <xmqqmso8wfnu.fsf@gitster.g>
- In-Reply-To
- <6cbb8444a6dabb883ac3b0e450c0bfbd17b58bea.1716983704.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> The `buf` parameter of `index_mem()` is a non-constant string. This will > break once we enable `-Wwrite-strings` because we also pass constants > from at least one callsite. > > Adapt the parameter to be a constant. As we cannot free the buffer > without casting now, this also requires us to move the lifetime of the > nested buffer around.
Makes sense.