[LTP] [PATCH 1/1] sparse-ltp: Fix bogus warning

Cyril Hrubis chrubis@suse.cz
Tue Jun 4 13:44:21 CEST 2024


Hi!
> tst_tmpdir.c:347:6: warning: Symbol 'tst_purge_dir' has no prototype or
> library ('tst_') prefix. Should it be static?

Actually this is a correct check. The idea is a bit different, we are
trying to make sure that there is a prototype in the headers for the
function. If that is true, the sym->same_symbol points to that symbol
instance and the check exists before it reaches that warning.

So the actuall problem here is that the prototype is in a strange place,
i.e. tst_device.h which is not included into tst_tmpdir.c.

Obvious fix would be including tst_device.h into tst_tmpdir.c however
I'm not sure that the function to purge the directory belongs to the
tst_device.h to begin with. Maybe we should add just tst_tmpdir.h with
that function and include it into right places, i.e. tst_test.h and
tst_tmpdir.c.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list