Re: [PATCH v2 5/7] rebase: drop support for `--preserve-merges`
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 2, 2021, 14:11 UTC
- Message-ID
- <87y28f9ic8.fsf@evledraar.gmail.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2109021553510.55@tvgsbejvaqbjf.bet>
On Thu, Sep 02 2021, Johannes Schindelin wrote:
Show 15 quoted lines
> Hi Ævar, > > On Wed, 1 Sep 2021, Ævar Arnfjörð Bjarmason wrote: > >> >> On Wed, Sep 01 2021, Johannes Schindelin via GitGitGadget wrote: >> >> > - struct strbuf script_snippet = STRBUF_INIT, buf = STRBUF_INIT; >> > + struct strbuf script_snippet = STRBUF_INIT; >> >> You end up removing all uses of script_snippet except the >> strbuf_release() for it, so this & that can be removed too. > > Valid point, I missed it because compiling with `DEVELOPER=1` did not > complain (because `strbuf_release()` "uses" the variable).
As an aside I was looking the other day to see if some variant of -Wunused was smart enough to exclude (preferably a configurable) list of functions. E.g.:
void *some_var = malloc(123);
free(some_var);Could be unused if something was smart to see that a thing only interacting with "malloc" and "free" wasn't otherwise used, and likewise we could add "strbuf_release" and other such free() functions to such a list.
But I didn't find anything...