[SAMBA 4] [PATCH] Fix IBM checker warnings

Andrew Kroeger andrew at id10ts.net
Fri Feb 8 12:31:11 GMT 2008


Andrew Bartlett wrote:
> On Fri, 2008-02-08 at 04:42 -0600, Andrew Kroeger wrote:
>> Samba Developers:
>>
>> I am attaching a couple of patches to correct a number of issues
>> discovered by the IBM checker.
>>
>> I am trying to adopt the Git development model, and have also posted the
>> same commits at git://git.id10ts.net/samba.git under the v4-0-checker
>> topic branch.
>>
>> I would appreciate if someone could evaluate these patches vs. my Git
>> repository and let me know if I am doing anything wrong with my Git
>> repository setup.
>>
>> Sincerely,
>> Andrew Kroeger
>> plain text document attachment (chk_1)
>> diff --git a/source/lib/replace/test/testsuite.c b/source/lib/replace/test/testsuite.c
>> index c9f3301..dee775e 100644
>> --- a/source/lib/replace/test/testsuite.c
>> +++ b/source/lib/replace/test/testsuite.c
>> @@ -879,50 +879,50 @@ struct torture_context;
>>  bool torture_local_replace(struct torture_context *ctx)
>>  {
>>  	bool ret = true;
>> -	ret &= test_ftruncate();
>> -	ret &= test_strlcpy();
> 
>> +	ret = ret && test_ftruncate();
>> +	ret = ret && test_strlcpy();
> 
> 
> I know it doesn't like this one, but I really do think it's quite an
> acceptable pattern in the torture code.  The only other suggestion I
> would make is, when in the main smbtortore code, to move to it's
> macro-based setup.

I agree the use may be acceptable (and it may not cause any direct
problems), but what it does do is cause a considerable increase to the
number of "errors" found by the IBM checker.

If we value the output of the IBM checker (and other such donated
products/services), it would be foolish to not adapt the solutions
presented by those tools.  Furthermore, Samba4 currently has shown
between 875 and 1117 issues (depending on the exact build) found by the
IBM checker.

My proposed patch attempts to eliminate over half of the checker
"errors".  Reducing the number of errors reported allows greater
attention to be paid to true errors/issues that occur by eliminating a
lot of the "cruft".

Sincerely,
Andrew Kroeger



More information about the samba-technical mailing list