Re: [PATCH 6/5] grep.c: mark eol/bol and derived as "const char * const"
- From
Jeff King <peff@peff.net>
- Date
- Sep 21, 2021, 19:18 UTC
- Message-ID
- <YUowCkmWqKgIldNz@coredump.intra.peff.net>
- In-Reply-To
- <874kadapq1.fsf@evledraar.gmail.com>
On Tue, Sep 21, 2021 at 05:17:57PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> > On Tue, Sep 21 2021, Jeff King wrote: > > > On Tue, Sep 21, 2021 at 02:45:16PM +0200, Ævar Arnfjörð Bjarmason wrote: > > > >> I think that generally git's codebase could use going beyond just > >> "const char *" when a "const char * const" would suffice, for some > >> reason we seem to mostly use it for the static usage variables. > > > > I didn't dig up the references in the list archive, but I feel like > > we've had this discussion long ago. One of the reasons not to do so is > > that it pollutes the function's interface with internal details.[...] > > Are there cases in my conversion where the caller has to do anything > special that they didn't before? These are also all static functions, so > it's all internal details exported to nobody.
No, they don't have to do anything differently. I just meant that it clutters the interface when a human is reading it.
-Peff