2024-03-27 04:16 ftp://ftp.de.debian.org/debian/pool/main/g/gbatnav/gbatnav_1.0.4cvs20051004.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --inline-suppr --disable=missingInclude --suppress=unmatchedSuppression --template=daca2 --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=valueFlowBailoutIncompleteVar -D__GNUC__ --platform=unix64 -j4 platform: Linux-6.1.0-0.deb11.6-amd64-x86_64-with-glibc2.31 python: 3.9.2 client-version: 1.3.45 compiler: g++ (Debian 10.2.1-6) 10.2.1 20210110 cppcheck: head 2.13.0 head-info: 99853e4 (2024-03-27 05:16:23 +0100) count: 68 67 elapsed-time: 5.5 12.4 head-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 4.47141s (avg. 4.47141s - 1 result(s)) valueFlowCondition(SimpleConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 1.57368s (avg. 0.52456s - 3 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 1.17461s (avg. 0.391538s - 3 result(s)) valueFlowCondition(SymbolicConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.89309s (avg. 0.297697s - 3 result(s)) valueFlowUninit(tokenlist, errorLogger, settings): 0.386446s (avg. 0.128815s - 3 result(s)) Overall time: 4.58764s old-timing-info: Tokenizer::simplifyTokens1::ValueFlow: 11.9052s (avg. 11.9052s - 1 result(s)) valueFlowConditionExpressions(tokenlist, symboldatabase, errorLogger, *settings): 11.2434s (avg. 11.2434s - 1 result(s)) valueFlowAfterAssign(tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.242264s (avg. 0.0807547s - 3 result(s)) valueFlowCondition(SymbolicConditionHandler{}, tokenlist, symboldatabase, errorLogger, settings, skippedFunctions): 0.137845s (avg. 0.0459483s - 3 result(s)) valueFlowForLoop(tokenlist, symboldatabase, errorLogger, settings): 0.110359s (avg. 0.0367863s - 3 result(s)) Overall time: 11.9559s head results: gbatnav-1.0.4cvs20051004.orig/common/bnwrite.c:20:22: error: va_list 'args' was opened but not closed by va_end(). [va_end_missing] gbatnav-1.0.4cvs20051004.orig/gbnclient/configure.c:17:13: style: Variable 'widget' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/gbnclient/configure.c:30:10: style: Variable 'widget' is assigned a value that is never used. [unreadVariable] gbatnav-1.0.4cvs20051004.orig/gbnclient/g_interface.c:450:79: error: There is an unknown macro here somewhere. Configuration is required. If VERSION is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/common/parser.c:26:38: style: Parameter 'igualador' can be declared as pointer to const [constParameterPointer] gbatnav-1.0.4cvs20051004.orig/common/parser.c:26:59: style: Parameter 'separador' can be declared as pointer to const [constParameterPointer] gbatnav-1.0.4cvs20051004.orig/common/parser.c:42:8: style: Parameter 'in' can be declared as pointer to const [constParameterPointer] gbatnav-1.0.4cvs20051004.orig/gbnclient/gbnclient.c:251:40: error: There is an unknown macro here somewhere. Configuration is required. If BN_READ is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/gbnclient/proceso.c:229:36: error: There is an unknown macro here somewhere. Configuration is required. If BN_READ is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/common/net.c:118:2: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] gbatnav-1.0.4cvs20051004.orig/common/net.c:162:2: style: Obsolescent function 'bzero' called. It is recommended to use 'memset' instead. [prohibitedbzeroCalled] gbatnav-1.0.4cvs20051004.orig/common/net.c:115:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] gbatnav-1.0.4cvs20051004.orig/common/net.c:159:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] gbatnav-1.0.4cvs20051004.orig/common/net.c:124:3: error: Memory leak: res [memleak] gbatnav-1.0.4cvs20051004.orig/common/net.c:169:3: error: Memory leak: res [memleak] gbatnav-1.0.4cvs20051004.orig/common/net.c:215:24: style: Parameter 'path' can be declared as pointer to const [constParameterPointer] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:126:7: style: Variable 'item' is reassigned a value before the old one has been used. [redundantAssignment] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:115:7: note: item is assigned gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:126:7: note: item is overwritten gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:137:7: style: Variable 'item' is reassigned a value before the old one has been used. [redundantAssignment] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:126:7: note: item is assigned gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:137:7: note: item is overwritten gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:150:7: style: Variable 'item' is reassigned a value before the old one has been used. [redundantAssignment] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:137:7: note: item is assigned gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:150:7: note: item is overwritten gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:200:7: style: Variable 'item' is reassigned a value before the old one has been used. [redundantAssignment] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:189:7: note: item is assigned gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:200:7: note: item is overwritten gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:102:19: style: Variable 'item' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:179:19: style: Variable 'item' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:150:7: style: Variable 'item' is assigned a value that is never used. [unreadVariable] gbatnav-1.0.4cvs20051004.orig/gbnclient/support.c:200:7: style: Variable 'item' is assigned a value that is never used. [unreadVariable] gbatnav-1.0.4cvs20051004.orig/gbnrobot/robot_proceso.c:232:40: error: There is an unknown macro here somewhere. Configuration is required. If BN_FIRE is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:32:41: style: Parameter 'widget' can be declared as pointer to const. However it seems that 'on_exit_activate' is a callback function, if 'widget' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:128:20: note: You might need to cast the function pointer here gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:32:41: note: Parameter 'widget' can be declared as pointer to const gbatnav-1.0.4cvs20051004.orig/gbnserver/gbnserver.c:405:3: error: There is an unknown macro here somewhere. Configuration is required. If VERSION is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/gbnserver/play.c:56:12: error: There is an unknown macro here somewhere. Configuration is required. If VERSION is a macro then please configure it. [unknownMacro] gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:50:30: style:inconclusive: Function '_nl_find_domain' argument 1 names different: declaration '__dirname' definition 'dirname'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:160:54: note: Function '_nl_find_domain' argument 1 names different: declaration '__dirname' definition 'dirname'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:50:30: note: Function '_nl_find_domain' argument 1 names different: declaration '__dirname' definition 'dirname'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:50:45: style:inconclusive: Function '_nl_find_domain' argument 2 names different: declaration '__locale' definition 'locale'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:160:71: note: Function '_nl_find_domain' argument 2 names different: declaration '__locale' definition 'locale'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:50:45: note: Function '_nl_find_domain' argument 2 names different: declaration '__locale' definition 'locale'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:51:16: style:inconclusive: Function '_nl_find_domain' argument 3 names different: declaration '__domainname' definition 'domainname'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:161:19: note: Function '_nl_find_domain' argument 3 names different: declaration '__domainname' definition 'domainname'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:51:16: note: Function '_nl_find_domain' argument 3 names different: declaration '__domainname' definition 'domainname'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:51:44: style:inconclusive: Function '_nl_find_domain' argument 4 names different: declaration '__domainbinding' definition 'domainbinding'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:162:23: note: Function '_nl_find_domain' argument 4 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/finddomain.c:51:44: note: Function '_nl_find_domain' argument 4 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:252:12: style: Local variable 'len' shadows outer variable [shadowVariable] gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:224:14: note: Shadowed declaration gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:252:12: note: Shadow variable gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:283:15: style: Local variable 'len' shadows outer variable [shadowVariable] gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:224:14: note: Shadowed declaration gbatnav-1.0.4cvs20051004.orig/intl/bindtextdom.c:283:15: note: Shadow variable gbatnav-1.0.4cvs20051004.orig/intl/localcharset.c:306:14: style: Condition 'locale==NULL' is always true [knownConditionTrueFalse] gbatnav-1.0.4cvs20051004.orig/intl/localcharset.c:297:24: note: Assignment 'locale=NULL', assigned value is 0 gbatnav-1.0.4cvs20051004.orig/intl/localcharset.c:306:14: note: Condition 'locale==NULL' is always true gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:544:10: style: Obsolescent function 'getwd' called. It is recommended to use 'getcwd' instead. [prohibitedgetwdCalled] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:583:39: style: Redundant condition: The condition 'categoryvalue[0] != '\0'' is redundant since 'categoryvalue[0] == ':'' is sufficient. [redundantCondition] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:25: style:inconclusive: Function 'libintl_dcigettext' argument 1 names different: declaration '__domainname' definition 'domainname'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:210:46: note: Function 'libintl_dcigettext' argument 1 names different: declaration '__domainname' definition 'domainname'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:25: note: Function 'libintl_dcigettext' argument 1 names different: declaration '__domainname' definition 'domainname'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:49: style:inconclusive: Function 'libintl_dcigettext' argument 2 names different: declaration '__msgid1' definition 'msgid1'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:211:18: note: Function 'libintl_dcigettext' argument 2 names different: declaration '__msgid1' definition 'msgid1'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:49: note: Function 'libintl_dcigettext' argument 2 names different: declaration '__msgid1' definition 'msgid1'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:69: style:inconclusive: Function 'libintl_dcigettext' argument 3 names different: declaration '__msgid2' definition 'msgid2'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:211:40: note: Function 'libintl_dcigettext' argument 3 names different: declaration '__msgid2' definition 'msgid2'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:427:69: note: Function 'libintl_dcigettext' argument 3 names different: declaration '__msgid2' definition 'msgid2'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:10: style:inconclusive: Function 'libintl_dcigettext' argument 4 names different: declaration '__plural' definition 'plural'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:212:10: note: Function 'libintl_dcigettext' argument 4 names different: declaration '__plural' definition 'plural'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:10: note: Function 'libintl_dcigettext' argument 4 names different: declaration '__plural' definition 'plural'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:36: style:inconclusive: Function 'libintl_dcigettext' argument 5 names different: declaration '__n' definition 'n'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:212:38: note: Function 'libintl_dcigettext' argument 5 names different: declaration '__n' definition 'n'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:36: note: Function 'libintl_dcigettext' argument 5 names different: declaration '__n' definition 'n'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:43: style:inconclusive: Function 'libintl_dcigettext' argument 6 names different: declaration '__category' definition 'category'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:213:10: note: Function 'libintl_dcigettext' argument 6 names different: declaration '__category' definition 'category'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:428:43: note: Function 'libintl_dcigettext' argument 6 names different: declaration '__category' definition 'category'. gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:533:13: style: Variable 'ret' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:224:9: style: struct member 'known_translation_t::domainname' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:227:7: style: struct member 'known_translation_t::category' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:230:7: style: struct member 'known_translation_t::counter' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:233:27: style: struct member 'known_translation_t::domain' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:236:15: style: struct member 'known_translation_t::translation' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:237:10: style: struct member 'known_translation_t::translation_length' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/dcigettext.c:240:8: style: struct member 'known_translation_t::msgid' is never used. [unusedStructMember] gbatnav-1.0.4cvs20051004.orig/intl/l10nflist.c:341:12: style: Variable 'dir' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/os2compat.c:51:9: style: Variable 'root' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/localealias.c:154:21: style: Variable 'retval' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/localealias.c:254:13: style: Variable 'alias' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/localealias.c:255:13: style: Variable 'value' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/localealias.c:172:41: error: Uninitialized variable: &item.value [uninitvar] /home/haible/gnu/arch/linuxlibc6/share/bison/bison.simple:517:36: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] /home/haible/gnu/arch/linuxlibc6/share/bison/bison.simple:515:9: style: Variable 'yyss1' can be declared as pointer to const [constVariablePointer] gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:982:2: error: Resource leak: fd [resourceLeak] gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:975:12: style: The comparison 'data == (struct mo_file_header*)-1' is always true because 'data' and '(struct mo_file_header*)-1' represent the same value. [knownConditionTrueFalse] gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:919:33: note: 'data' is assigned value '(struct mo_file_header*)-1' here. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:975:12: note: The comparison 'data == (struct mo_file_header*)-1' is always true because 'data' and '(struct mo_file_header*)-1' represent the same value. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:771:47: style:inconclusive: Function '_nl_init_domain_conv' argument 1 names different: declaration '__domain_file' definition 'domain_file'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:169:59: note: Function '_nl_init_domain_conv' argument 1 names different: declaration '__domain_file' definition 'domain_file'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:771:47: note: Function '_nl_init_domain_conv' argument 1 names different: declaration '__domain_file' definition 'domain_file'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:772:31: style:inconclusive: Function '_nl_init_domain_conv' argument 2 names different: declaration '__domain' definition 'domain'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:170:29: note: Function '_nl_init_domain_conv' argument 2 names different: declaration '__domain' definition 'domain'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:772:31: note: Function '_nl_init_domain_conv' argument 2 names different: declaration '__domain' definition 'domain'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:773:25: style:inconclusive: Function '_nl_init_domain_conv' argument 3 names different: declaration '__domainbinding' definition 'domainbinding'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:171:23: note: Function '_nl_init_domain_conv' argument 3 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:773:25: note: Function '_nl_init_domain_conv' argument 3 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:889:45: style:inconclusive: Function '_nl_free_domain_conv' argument 1 names different: declaration '__domain' definition 'domain'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:173:50: note: Function '_nl_free_domain_conv' argument 1 names different: declaration '__domain' definition 'domain'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:889:45: note: Function '_nl_free_domain_conv' argument 1 names different: declaration '__domain' definition 'domain'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:909:42: style:inconclusive: Function '_nl_load_domain' argument 1 names different: declaration '__domain' definition 'domain_file'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:164:47: note: Function '_nl_load_domain' argument 1 names different: declaration '__domain' definition 'domain_file'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:909:42: note: Function '_nl_load_domain' argument 1 names different: declaration '__domain' definition 'domain_file'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:910:20: style:inconclusive: Function '_nl_load_domain' argument 2 names different: declaration '__domainbinding' definition 'domainbinding'. [funcArgNamesDifferent] gbatnav-1.0.4cvs20051004.orig/intl/gettextP.h:165:25: note: Function '_nl_load_domain' argument 2 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/loadmsgcat.c:910:20: note: Function '_nl_load_domain' argument 2 names different: declaration '__domainbinding' definition 'domainbinding'. gbatnav-1.0.4cvs20051004.orig/intl/vasnprintf.c:748:12: style: Variable 'arg' can be declared as pointer to const [constVariablePointer] diff: head gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:32:41: style: Parameter 'widget' can be declared as pointer to const. However it seems that 'on_exit_activate' is a callback function, if 'widget' is declared with const you might also need to cast function pointer(s). [constParameterCallback] gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:128:20: note: You might need to cast the function pointer here gbatnav-1.0.4cvs20051004.orig/gbnserver/g_interface.c:32:41: note: Parameter 'widget' can be declared as pointer to const DONE