Re: [PATCH/RFC 0/3] pedantic errors in next
- From
- Eric Wong <e@80x24.org>
- Date
- Aug 9, 2021, 20:10 UTC
- Message-ID
- <20210809201050.GA8077@dcvr>
- In-Reply-To
- <xmqqtujyftzx.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Carlo Marcelo Arenas Belón <carenas@gmail.com> writes: > > > Building next with pedantic enabled shows the following 2 issues that > > were originally in ew/many-alternate-optim, apologies for not catching > > them earlier. > > This of course affects 'master'. > > The first two look trivially correct and I am tempted to take them > in -rc2; the last one, from my cursory look, I didn't see anything > wrong in it, but is not all that urgent, either.
Agreed on all counts.
I've been starting to think oidtree/cbtree would be better done as BSD-style macro-defined functions (similar to how khash.h is, or sys/{queue,tree}.h on *BSD systems).
I prefer Linux(kernel)-style container_of generics since I find them easier-to-follow and have extra type-checking, but with a flex-array it's not pedantically correct.
So I guess using CPP like khash does might be a better way to go, here.
Thoughts?
Side note: I've also been considering Perl as a more powerful CPP replacement so I could use the same code for a persistent on-disk store (it would be easier to swap in pread/mmap use). An on-disk format could make it good for refs and pre-packed object storage (perhaps replacing loose objects).