BIND 10 #2278: Errors from cppcheck 1.56
BIND 10 Development
do-not-reply at isc.org
Mon Sep 24 10:14:12 UTC 2012
#2278: Errors from cppcheck 1.56
-------------------------------------+-------------------------------------
Reporter: | Owner:
vorner | Status: new
Type: | Milestone: New Tasks
defect | Resolution:
Priority: | Sensitive: 0
medium | Sub-Project: DNS
Component: | Estimated Difficulty: 0
Unclassified | Total Hours: 0
Keywords: |
Defect Severity: N/A |
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Description changed by naokikambe:
Old description:
> My system upgraed cppcheck to yet newer version 1.56, and again it
> provides me with a bunch of suggestions. This time there's a lot of them,
> so I don't see if a branch adds any new ones against master.
>
> {{{
> src/bin/auth/tests/query_unittest.cc:768: check_fail: Dereferenced
> iterator 'found_rrset' has been erased (error,eraseDereference)
> src/bin/auth/tests/query_unittest.cc:835: check_fail: Dereferenced
> iterator 'nsec_it' has been erased (error,eraseDereference)
> src/bin/auth/tests/query_unittest.cc:889: check_fail: Dereferenced
> iterator 'nsec_it' has been erased (error,eraseDereference)
> :: check_fail: Skipping configuration 'IPV6_MTU' because it seems to be
> invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration
> 'IPV6_MTU_DISCOVER;IPV6_PMTUDISC_DONT' because it seems to be invalid.
> Use -D if you want to check it. (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration 'IPV6_USE_MIN_MTU' because it seems
> to be invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration 'IPV6_RECVPKTINFO' because it seems
> to be invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration 'IP_PKTINFO' because it seems to be
> invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> src/lib/dhcp/tests/iface_mgr_unittest.cc:837: check_fail: Inefficient
> usage of string::find in condition; string::compare would be faster.
> (performance,stlIfStrFind)
> src/lib/dns/benchmarks/message_renderer_bench.cc:42: check_fail: Member
> variable 'MessageRendererBenchMark::renderer_' is not initialized in the
> constructor. (warning,uninitMemberVar)
> src/lib/dns/benchmarks/message_renderer_bench.cc:42: check_fail: Member
> variable 'MessageRendererBenchMark::names_' is not initialized in the
> constructor. (warning,uninitMemberVar)
> src/lib/dns/benchmarks/rdatarender_bench.cc:44: check_fail: Member
> variable 'RdataRenderBenchMark::renderer_' is not initialized in the
> constructor. (warning,uninitMemberVar)
> src/lib/dns/benchmarks/rdatarender_bench.cc:47: check_fail: Member
> variable 'RdataRenderBenchMark::dataset_' is not initialized in the
> constructor. (warning,uninitMemberVar)
> src/lib/dns/benchmarks/rdatarender_bench.cc:47: check_fail: Member
> variable 'RdataRenderBenchMark::renderer_' is not initialized in the
> constructor. (warning,uninitMemberVar)
> src/lib/dns/python/edns_python.cc:272: check_fail: The scope of the
> variable 'edns_obj' can be reduced (style,variableScope)
> src/lib/dns/rdata/generic/afsdb_18.cc:60: check_fail: Unused variable:
> server (style,unusedVariable)
> src/lib/dns/rdataclass.cc:607: check_fail: Unused variable: server
> (style,unusedVariable)
> src/lib/dns/tests/rrparamregistry_unittest.cc:40: check_fail: Variable
> 'test_class_unknown_str' is assigned in constructor body. Consider
> performing initialization in initialization list.
> (performance,useInitializationList)
> src/lib/log/compiler/message.cc:112: check_fail: Obsolete function
> 'ctime' called. It is recommended to use the function 'strftime' instead.
> (style,obsoleteFunctionsctime)
> :: check_fail: Skipping configuration 'ENABLE_LOGGER_CHECKS;EXPECT_DEATH'
> because it seems to be invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> src/lib/log/tests/logger_example.cc:121: check_fail: Unused variable:
> options (style,unusedVariable)
> :: check_fail: Skipping configuration 'EXPECT_DEATH' because it seems to
> be invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration 'CMSG_LEN' because it seems to be
> invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> :: check_fail: Skipping configuration 'CMSG_SPACE' because it seems to be
> invalid. Use -D if you want to check it.
> (information,ConfigurationNotChecked)
> src/lib/dhcp/libdhcp++.cc:149: check_fail: The function
> 'OptionFactoryRegister' is never used (style,unusedFunction)
> src/lib/python/isc/acl/dns.cc:93: check_fail: The function 'PyInit__dns'
> is never used (style,unusedFunction)
> src/lib/python/isc/acl/acl.cc:50: check_fail: The function 'PyInit_acl'
> is never used (style,unusedFunction)
> src/lib/python/isc/datasrc/datasrc.cc:257: check_fail: The function
> 'PyInit_datasrc' is never used (style,unusedFunction)
> src/lib/util/io/fdshare_python.cc:64: check_fail: The function
> 'PyInit_libutil_io_python' is never used (style,unusedFunction)
> src/lib/python/isc/log/log.cc:712: check_fail: The function 'PyInit_log'
> is never used (style,unusedFunction)
> src/lib/dns/python/pydnspp.cc:770: check_fail: The function
> 'PyInit_pydnspp' is never used (style,unusedFunction)
> src/lib/util/pyunittests/pyunittests_util.cc:82: check_fail: The function
> 'PyInit_pyunittests_util' is never used (style,unusedFunction)
> src/lib/python/isc/util/cio/socketsession_python.cc:53: check_fail: The
> function 'PyInit_socketsession' is never used (style,unusedFunction)
> 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)
> src/bin/sockcreator/tests/sockcreator_tests.cc:109: check_fail: The
> function 'addressFamilySpecificCheck' is never used
> (style,unusedFunction)
> src/lib/log/log_formatter.cc:57: check_fail: The function
> 'checkExcessPlaceholders' is never used (style,unusedFunction)
> src/lib/datasrc/memory_datasrc.cc:448: check_fail: The function
> 'findNode' is never used (style,unusedFunction)
> src/lib/nsas/tests/nameserver_address_unittest.cc:67: check_fail: The
> function 'getAddressesCount' is never used (style,unusedFunction)
> src/lib/log/logger.cc:33: check_fail: The function 'initLoggerImpl' is
> never used (style,unusedFunction)
> src/lib/util/tests/lru_list_unittest.cc:96: check_fail: The function
> 'invalidateIterator' is never used (style,unusedFunction)
> src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc:225: check_fail:
> The function 'isOutputTruncated<OutputBuffer>' is never used
> (style,unusedFunction)
> src/lib/util/unittests/newhook.cc:37: check_fail: The function
> 'operatordelete' is never used (style,unusedFunction)
> src/lib/util/unittests/newhook.cc:24: check_fail: The function
> 'operatornew' is never used (style,unusedFunction)
> src/lib/asiolink/io_address.cc:93: check_fail: The function
> 'operatoruint32_t' is never used (style,unusedFunction)
> src/lib/log/compiler/message.cc:379: check_fail: The function
> 'replaceNonAlphaNum' 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/util/tests/lru_list_unittest.cc:67: check_fail: The function
> 'setLruIterator' 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)
> src/lib/resolve/recursive_query.cc:252: check_fail: The function
> 'setQuestion' is never used (style,unusedFunction)
> src/lib/asiodns/tests/dns_server_unittest.cc:92: check_fail: The function
> 'setServerToStop' is never used (style,unusedFunction)
> src/lib/resolve/tests/recursive_query_unittest.cc:697: check_fail: The
> function 'setSocketTimeout' is never used (style,unusedFunction)
> src/lib/resolve/tests/recursive_query_unittest.cc:713: check_fail: The
> function 'tryRead' is never used (style,unusedFunction)
> src/lib/cache/tests/rrset_entry_unittest.cc:53: check_fail: The function
> 'updateTTLForTest' is never used (style,unusedFunction)
> }}}
New description:
My system upgraded cppcheck to yet newer version 1.56, and again it
provides me with a bunch of suggestions. This time there's a lot of them,
so I don't see if a branch adds any new ones against master.
{{{
src/bin/auth/tests/query_unittest.cc:768: check_fail: Dereferenced
iterator 'found_rrset' has been erased (error,eraseDereference)
src/bin/auth/tests/query_unittest.cc:835: check_fail: Dereferenced
iterator 'nsec_it' has been erased (error,eraseDereference)
src/bin/auth/tests/query_unittest.cc:889: check_fail: Dereferenced
iterator 'nsec_it' has been erased (error,eraseDereference)
:: check_fail: Skipping configuration 'IPV6_MTU' because it seems to be
invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
:: check_fail: Skipping configuration
'IPV6_MTU_DISCOVER;IPV6_PMTUDISC_DONT' because it seems to be invalid. Use
-D if you want to check it. (information,ConfigurationNotChecked)
:: check_fail: Skipping configuration 'IPV6_USE_MIN_MTU' because it seems
to be invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
:: check_fail: Skipping configuration 'IPV6_RECVPKTINFO' because it seems
to be invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
:: check_fail: Skipping configuration 'IP_PKTINFO' because it seems to be
invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
src/lib/dhcp/tests/iface_mgr_unittest.cc:837: check_fail: Inefficient
usage of string::find in condition; string::compare would be faster.
(performance,stlIfStrFind)
src/lib/dns/benchmarks/message_renderer_bench.cc:42: check_fail: Member
variable 'MessageRendererBenchMark::renderer_' is not initialized in the
constructor. (warning,uninitMemberVar)
src/lib/dns/benchmarks/message_renderer_bench.cc:42: check_fail: Member
variable 'MessageRendererBenchMark::names_' is not initialized in the
constructor. (warning,uninitMemberVar)
src/lib/dns/benchmarks/rdatarender_bench.cc:44: check_fail: Member
variable 'RdataRenderBenchMark::renderer_' is not initialized in the
constructor. (warning,uninitMemberVar)
src/lib/dns/benchmarks/rdatarender_bench.cc:47: check_fail: Member
variable 'RdataRenderBenchMark::dataset_' is not initialized in the
constructor. (warning,uninitMemberVar)
src/lib/dns/benchmarks/rdatarender_bench.cc:47: check_fail: Member
variable 'RdataRenderBenchMark::renderer_' is not initialized in the
constructor. (warning,uninitMemberVar)
src/lib/dns/python/edns_python.cc:272: check_fail: The scope of the
variable 'edns_obj' can be reduced (style,variableScope)
src/lib/dns/rdata/generic/afsdb_18.cc:60: check_fail: Unused variable:
server (style,unusedVariable)
src/lib/dns/rdataclass.cc:607: check_fail: Unused variable: server
(style,unusedVariable)
src/lib/dns/tests/rrparamregistry_unittest.cc:40: check_fail: Variable
'test_class_unknown_str' is assigned in constructor body. Consider
performing initialization in initialization list.
(performance,useInitializationList)
src/lib/log/compiler/message.cc:112: check_fail: Obsolete function 'ctime'
called. It is recommended to use the function 'strftime' instead.
(style,obsoleteFunctionsctime)
:: check_fail: Skipping configuration 'ENABLE_LOGGER_CHECKS;EXPECT_DEATH'
because it seems to be invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
src/lib/log/tests/logger_example.cc:121: check_fail: Unused variable:
options (style,unusedVariable)
:: check_fail: Skipping configuration 'EXPECT_DEATH' because it seems to
be invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
:: check_fail: Skipping configuration 'CMSG_LEN' because it seems to be
invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
:: check_fail: Skipping configuration 'CMSG_SPACE' because it seems to be
invalid. Use -D if you want to check it.
(information,ConfigurationNotChecked)
src/lib/dhcp/libdhcp++.cc:149: check_fail: The function
'OptionFactoryRegister' is never used (style,unusedFunction)
src/lib/python/isc/acl/dns.cc:93: check_fail: The function 'PyInit__dns'
is never used (style,unusedFunction)
src/lib/python/isc/acl/acl.cc:50: check_fail: The function 'PyInit_acl' is
never used (style,unusedFunction)
src/lib/python/isc/datasrc/datasrc.cc:257: check_fail: The function
'PyInit_datasrc' is never used (style,unusedFunction)
src/lib/util/io/fdshare_python.cc:64: check_fail: The function
'PyInit_libutil_io_python' is never used (style,unusedFunction)
src/lib/python/isc/log/log.cc:712: check_fail: The function 'PyInit_log'
is never used (style,unusedFunction)
src/lib/dns/python/pydnspp.cc:770: check_fail: The function
'PyInit_pydnspp' is never used (style,unusedFunction)
src/lib/util/pyunittests/pyunittests_util.cc:82: check_fail: The function
'PyInit_pyunittests_util' is never used (style,unusedFunction)
src/lib/python/isc/util/cio/socketsession_python.cc:53: check_fail: The
function 'PyInit_socketsession' is never used (style,unusedFunction)
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)
src/bin/sockcreator/tests/sockcreator_tests.cc:109: check_fail: The
function 'addressFamilySpecificCheck' is never used (style,unusedFunction)
src/lib/log/log_formatter.cc:57: check_fail: The function
'checkExcessPlaceholders' is never used (style,unusedFunction)
src/lib/datasrc/memory_datasrc.cc:448: check_fail: The function 'findNode'
is never used (style,unusedFunction)
src/lib/nsas/tests/nameserver_address_unittest.cc:67: check_fail: The
function 'getAddressesCount' is never used (style,unusedFunction)
src/lib/log/logger.cc:33: check_fail: The function 'initLoggerImpl' is
never used (style,unusedFunction)
src/lib/util/tests/lru_list_unittest.cc:96: check_fail: The function
'invalidateIterator' is never used (style,unusedFunction)
src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc:225: check_fail:
The function 'isOutputTruncated<OutputBuffer>' is never used
(style,unusedFunction)
src/lib/util/unittests/newhook.cc:37: check_fail: The function
'operatordelete' is never used (style,unusedFunction)
src/lib/util/unittests/newhook.cc:24: check_fail: The function
'operatornew' is never used (style,unusedFunction)
src/lib/asiolink/io_address.cc:93: check_fail: The function
'operatoruint32_t' is never used (style,unusedFunction)
src/lib/log/compiler/message.cc:379: check_fail: The function
'replaceNonAlphaNum' 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/util/tests/lru_list_unittest.cc:67: check_fail: The function
'setLruIterator' 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)
src/lib/resolve/recursive_query.cc:252: check_fail: The function
'setQuestion' is never used (style,unusedFunction)
src/lib/asiodns/tests/dns_server_unittest.cc:92: check_fail: The function
'setServerToStop' is never used (style,unusedFunction)
src/lib/resolve/tests/recursive_query_unittest.cc:697: check_fail: The
function 'setSocketTimeout' is never used (style,unusedFunction)
src/lib/resolve/tests/recursive_query_unittest.cc:713: check_fail: The
function 'tryRead' is never used (style,unusedFunction)
src/lib/cache/tests/rrset_entry_unittest.cc:53: check_fail: The function
'updateTTLForTest' is never used (style,unusedFunction)
}}}
--
--
Ticket URL: <http://bind10.isc.org/ticket/2278#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list