#876726 apt-1.5/methods/http.cc: 3 * bad style comparisons ?

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
David Binderman
Date:
2017-09-25 10:27:03 UTC
Severity:
minor
#876726#5
Date:
2017-09-25 10:14:27 UTC
From:
To:
[apt-1.5/methods/http.cc:369]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.
[apt-1.5/methods/http.cc:377]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.
[apt-1.5/methods/http.cc:394]: (style) Comparison of a function returning boolean value using relational (<, >, <= or >=) operator.

The source code for the first one:

   while (Out.WriteSpace() > 0)

#876726#10
Date:
2017-09-25 10:18:47 UTC
From:
To:
Control: severity -1 minor

What did you check that with?

Anyway, it's true, but a minor cosmetic issue. It probably makes
sense to either change WriteSpace() to return the free space, or
to change the conditions to remove > 0.

#876726#17
Date:
2017-09-25 10:22:04 UTC
From:
To:
A static analyser for C and C++ called cppcheck.

Indeed, that's why it is marked as a style issue.