Warning cleanup‏

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Oct 1 02:13:00 MDT 2013


I was looking though the compile warnings and came across the following one.
../source4/libcli/clilist.c: In function ‘smbcli_list_new’:
../source4/libcli/clilist.c:114:21: warning: variable
‘ff_searchcount’ set but not used [-Wunused-but-set-variable]

The warning is about ff_searchcount being assigned and never used. I
would usually just remove the variable and assignments however in the
while loop, it has.
while (1)
   state.ff_searchcount = 0;
   ff_searchcount = first_parms.t2ffirst.out.count;

Can this variable be removed? or
Should it be assigned to something like state.ff_searchcount?

The "first_parms.t2ffirst.out.count" is assigned to the received
variable and than that value is return from the function.


Best Regards
Alistair Leslie-Hughes

More information about the samba-technical mailing list