Re: [PATCH 4/4] progress.c: silence cgcc suggestion about internal linkage
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Apr 24, 2020, 00:58 UTC
- Message-ID
- <cbe8fcac-d7d5-8db2-cf69-6f04136337c9@ramsayjones.plus.com>
- In-Reply-To
- <dddf2d402702a616e04e7e446e31e0c6697d8c49.1587648870.git.congdanhqx@gmail.com>
On 23/04/2020 14:47, Đoàn Trần Công Danh wrote:
Show 19 quoted lines
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> > --- > progress.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/progress.c b/progress.c > index 19805ac646..fb53a2ec0c 100644 > --- a/progress.c > +++ b/progress.c > @@ -50,7 +50,9 @@ static volatile sig_atomic_t progress_update; > * These are only intended for testing the progress output, i.e. exclusively > * for 'test-tool progress'. > */ > +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).
But this works as well. :D
ATB, Ramsay Jones