From: Junio C Hamano Date: Wed, 29 May 2024 20:01:57 GMT Subject: Re: [PATCH 09/19] object-file: make `buf` parameter of `index_mem()` a constant Message-ID: In-Reply-To: <6cbb8444a6dabb883ac3b0e450c0bfbd17b58bea.1716983704.git.ps@pks.im> Patrick Steinhardt writes: > 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.