Re: [PATCH] reftable: fix some sparse warnings
From: Ramsay Jones <hidden>
Date: 2020-09-30 20:18:20
On 30/09/2020 17:51, Han-Wen Nienhuys wrote:
On Wed, Sep 23, 2020 at 12:47 AM Ramsay Jones [off-list ref] wrote:
quoted
If you need to re-roll your 'hn/reftable' branch, could you please squash this into the relevant patches.Thanks for the heads-up. I fixed some of these issues in the source at google/reftable. I've seen a Helped-By footer used to acknowledge these types of contributions, but I'm not sure on which of the 13 commits I should put that; suggestions?
I will leave you to decide, but I didn't actually do much (sparse did most of the heavy lifting)! ;-)
quoted
This patch is based on top of 'seen' and removes 20 sparse warnings (19 of theCould you tell me how I can run these checks myself?
$ make sparse
You will need to install a suitably new version of sparse, of course.
I believe (but don't quote me) that debian testing has a suitable
version based on the 'maint-v0.6.2' branch. ('git describe maint-v0.6.2'
shows that it has four commits on top of the last official release
version: v0.6.2-4-gb47eba20). Having said that, v0.6.2 should also be
fine (I build from source, so have version v0.6.2-201-g24bdaac6).
[for more sparse info, see: https://sparse.docs.kernel.org]
quoted
Just for your information, you may want to look at the following 27 symbols:quoted
> reftable/merged.o - reftable_merged_table_hash_id > reftable/merged.o - reftable_merged_table_max_update_index > reftable/merged.o - reftable_merged_table_min_update_index > reftable/merged.o - reftable_merged_table_seek_log_at > reftable/publicbasics.o - reftable_error_to_errno > reftable/publicbasics.o - reftable_set_alloc > reftable/reader.o - reftable_reader_seek_log_at > reftable/stack.o - reftable_addition_close > reftable/stack.o - reftable_stack_auto_compactThese functions are part of the public API. We'll need to get the reftable glue code into seen. Perhaps some need unittest coverage too.
So, do I take it that the other 18 symbols are now marked 'static'? [you would need 'static-check.pl' to catch symbols like the above]. ATB, Ramsay Jones