Re: [PATCH 4/4] progress.c: silence cgcc suggestion about internal linkage
- From
Jeff King <peff@peff.net>
- Date
- Apr 24, 2020, 05:54 UTC
- Message-ID
- <20200424055417.GH1648190@coredump.intra.peff.net>
- In-Reply-To
- <cbe8fcac-d7d5-8db2-cf69-6f04136337c9@ramsayjones.plus.com>
On Fri, Apr 24, 2020 at 01:58:51AM +0100, Ramsay Jones wrote:
Show 11 quoted lines
> > +extern int progress_testing; /* to silence sparse: internal linkage */ > > int progress_testing; > > +extern uint64_t progress_test_ns; /* to silence sparse: internal linkage */ > > uint64_t progress_test_ns = 0; > > void progress_test_force_update(void); /* To silence -Wmissing-prototypes */ > > void progress_test_force_update(void) > > My preference would be to add these extern declarations to the > progress.h header file, with a note that they are only used by > the 't/helper/test-progress.c' test helper. (Also, remove the > extern declarations from test-progress.c, of course).
I came here to say the same thing.
As a bonus, it would catch any changes to the types in the future (rather than just segfaulting when test-progress.c attempts to use an out-of-date type).
-Peff