BIND 10 #2278: Errors from cppcheck 1.56

BIND 10 Development do-not-reply at isc.org
Wed Oct 3 13:07:06 UTC 2012


#2278: Errors from cppcheck 1.56
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  vorner
  vorner                             |                Status:  reviewing
                       Type:         |             Milestone:
  defect                             |  Sprint-20121009
                   Priority:         |            Resolution:
  medium                             |             Sensitive:  0
                  Component:         |           Sub-Project:  DNS
  Unclassified                       |  Estimated Difficulty:  6
                   Keywords:         |           Total Hours:  0
            Defect Severity:  N/A    |
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by jelte):

 * owner:  jelte => vorner


Comment:

 Replying to [comment:7 vorner]:
 >
 > You changed the thing around formatting time. Is the trim function used
 any more anywhere?
 >

 yeah, the message_reader still uses it, and util/filename appears to use
 it as well.

 > I'm not sure I understand the thing with unused functions. Are the
 functions used or not? Are they used in some strange way so cppcheck
 doesn't see them?
 >

 I've seen three different causes of reports
 1. Demonstrably false positives in the vicinity of templates; like
 {{{
 src/lib/log/logger.cc:33: check_fail: The function 'initLoggerImpl' is
 never used (style,unusedFunction)
 src/bin/sockcreator/tests/sockcreator_tests.cc:52: check_fail: The
 function 'setAddressFamilyFields' is never used (style,unusedFunction)
 src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc:215: check_fail:
 The function 'setOutputLengthLimit<OutputBuffer>' is never used
 (style,unusedFunction)
 }}}

 In these cases, it would seem cppcheck does not do templating well.

 2. Grey areas; mainly all the PyINIT functions, these are indeed never
 explicitely called, but are called dynamically by python magic.

 3. Ones that appear to be direct false positives, but I don't have any
 clue why these are flagged and others not;
 {{{
 src/lib/util/hash/sha1.cc:209: check_fail: The function 'SHA1FinalBits' is
 never used (style,unusedFunction)
 src/bin/auth/tests/datasrc_configurator_unittest.cc:115: check_fail: The
 function 'SetUp' is never used (style,unusedFunction)
 src/bin/auth/tests/datasrc_configurator_unittest.cc:97: check_fail: The
 function 'TearDown' is never used (style,unusedFunction)
 }}}

 In some cases (at least the ones for 2 and most of the ones for 3), we
 could work around it by sticking them in a header, or adding an early
 declaration (which works around the report but would be useless
 functionality-wise). If we decide to do that we can probably add local
 suppressions for the rest.

 > About the known false positives, is there a bug report on cppcheck or
 something?
 >

 For the iterators there is:
 http://sourceforge.net/apps/trac/cppcheck/ticket/4123

 I did find several old reports about unused functions, but no new open
 ones, so I guess none for the latter, it's certainly not fixed in the
 current master branch of cppcheck.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2278#comment:8>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list