2022-06-24 02:54 ftp://ftp.de.debian.org/debian/pool/main/o/omega-rpg/omega-rpg_0.90-pa9.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --inline-suppr --template=daca2 -D__GNUC__ --platform=unix64 -rp=temp -j1 platform: Linux-5.10.0-9-amd64-x86_64-with-glibc2.31 python: 3.9.2 client-version: 1.3.25 compiler: g++ (Debian 10.2.1-6) 10.2.1 20210110 cppcheck: head 2.8 head-info: 60c1eef (2022-06-23 20:26:47 +0200) count: 99 99 elapsed-time: 9.8 11.3 head-timing-info: Tokenizer::simplifyTokens1: 8.1691s (avg. 0.136152s - 60 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 5.71827s (avg. 0.0953045s - 60 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 1.03648s (avg. 0.0172746s - 60 result(s)) Tokenizer::createTokens: 0.425132s (avg. 0.00708553s - 60 result(s)) Tokenizer::simplifyTokens1::setValueType: 0.195153s (avg. 0.00325255s - 60 result(s)) Overall time: 16.7714s old-timing-info: Tokenizer::simplifyTokens1: 9.69423s (avg. 0.16157s - 60 result(s)) Tokenizer::simplifyTokens1::ValueFlow: 7.25505s (avg. 0.120918s - 60 result(s)) Tokenizer::simplifyTokens1::createSymbolDatabase: 0.997089s (avg. 0.0166182s - 60 result(s)) Tokenizer::createTokens: 0.421148s (avg. 0.00701913s - 60 result(s)) Other::runChecks: 0.195973s (avg. 0.00326622s - 60 result(s)) Overall time: 19.7879s head results: omega-rpg-0.90-pa9.orig/aux2.c:974:16: style: Variable 'emerging' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/aux2.c:1035:16: style: Variable 'emerging' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/aux3.c:934:15: warning: Either the condition 'pos>0' is redundant or the array 'prefix[80]' is accessed at index -1, which is out of bounds. [negativeIndex] omega-rpg-0.90-pa9.orig/aux3.c:932:15: note: Assuming that condition 'pos>0' is not redundant omega-rpg-0.90-pa9.orig/aux3.c:933:18: note: pos is decremented', new value is 0 omega-rpg-0.90-pa9.orig/aux3.c:934:15: note: Negative array index omega-rpg-0.90-pa9.orig/aux3.c:985:17: style: Condition 'first==last' is always false [knownConditionTrueFalse] omega-rpg-0.90-pa9.orig/aux3.c:978:13: note: Assuming that condition 'lnext()->astOperand1() [DacaWrongData] omega-rpg-0.90-pa9.orig/compress.c:1303:2: style: Obsolescent function 'utime' called. It is recommended to use 'utimensat' instead. [prohibitedutimeCalled] omega-rpg-0.90-pa9.orig/compress.c:1067:16: style: Local variable 'offset' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/compress.c:682:12: note: Shadowed declaration omega-rpg-0.90-pa9.orig/compress.c:1067:16: note: Shadow variable omega-rpg-0.90-pa9.orig/compress.c:1068:22: style: Local variable 'buf' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/compress.c:838:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/compress.c:1068:22: note: Shadow variable omega-rpg-0.90-pa9.orig/compress.c:706:25: style: Variable 'i' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/compress.c:1295:7: style: Variable 'mode' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/effect1.c:10:14: style: Variable 'used' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/env.c:295:28: style: Variable 'Level->site[i][j].locchar' is reassigned a value before the old one has been used. [redundantAssignment] omega-rpg-0.90-pa9.orig/env.c:294:28: note: Level->site[i][j].locchar is assigned omega-rpg-0.90-pa9.orig/env.c:295:28: note: Level->site[i][j].locchar is overwritten omega-rpg-0.90-pa9.orig/fixstr.c:111:11: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] omega-rpg-0.90-pa9.orig/fixstr.c:103:8: error: Common realloc mistake: 'string_list' nulled but not freed upon failure [memleakOnRealloc] omega-rpg-0.90-pa9.orig/fixstr.c:80:64: style: Argument '(max_strings=500)*sizeof(char*)' to function malloc is always 4000. It does not matter what value 'max_strings' has. [knownArgument] omega-rpg-0.90-pa9.orig/genclr.c:314:5: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] omega-rpg-0.90-pa9.orig/genclr.c:314:5: warning: %d in format string (no. 3) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] omega-rpg-0.90-pa9.orig/genclr.c:334:2: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] omega-rpg-0.90-pa9.orig/genclr.c:350:2: warning: %d in format string (no. 4) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] omega-rpg-0.90-pa9.orig/genclr.c:255:3: error: Common realloc mistake: 'opairs' nulled but not freed upon failure [memleakOnRealloc] omega-rpg-0.90-pa9.orig/guild2.c:536:20: style: Condition 'Player.level>Grandmasterlevel' is always true [knownConditionTrueFalse] omega-rpg-0.90-pa9.orig/guild2.c:533:21: note: Assuming condition 'Player.level<=Grandmasterlevel' is false omega-rpg-0.90-pa9.orig/guild2.c:536:20: note: Condition 'Player.level>Grandmasterlevel' is always true omega-rpg-0.90-pa9.orig/inv.c:836:7: style: Local variable 'quit' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:189:6: note: Shadowed declaration omega-rpg-0.90-pa9.orig/inv.c:836:7: note: Shadow variable omega-rpg-0.90-pa9.orig/inv.c:898:7: style: Local variable 'quit' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:189:6: note: Shadowed declaration omega-rpg-0.90-pa9.orig/inv.c:898:7: note: Shadow variable omega-rpg-0.90-pa9.orig/inv.c:1345:20: style: Variable 'num' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/inv.c:1392:27: style: Variable 'num' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/inv.c:1392:35: style: Variable 'trade' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/inv.c:1392:45: style: Variable 'put' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/inv.c:1392:56: style: Variable 'take' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/inv.c:1392:68: style: Variable 'merge' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/map.c:135:7: style: Local variable 'version' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:194:6: note: Shadowed declaration omega-rpg-0.90-pa9.orig/map.c:135:7: note: Shadow variable omega-rpg-0.90-pa9.orig/map.c:21:7: style: struct member 'symbolMapping::locationFunction' is never used. [unusedStructMember] omega-rpg-0.90-pa9.orig/map.c:24:7: style: struct member 'symbolMapping::argument' is never used. [unusedStructMember] omega-rpg-0.90-pa9.orig/mon.c:804:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:804:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:825:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:825:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:842:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:842:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:858:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:858:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:876:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:876:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:891:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:891:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:908:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:908:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:925:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:925:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:942:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:942:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:959:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:959:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:977:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:977:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:997:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:997:8: note: Shadow variable omega-rpg-0.90-pa9.orig/mon.c:1013:8: style: Local variable 'Str1' shadows outer variable [shadowVariable] omega-rpg-0.90-pa9.orig/glob.h:261:13: note: Shadowed declaration omega-rpg-0.90-pa9.orig/mon.c:1013:8: note: Shadow variable omega-rpg-0.90-pa9.orig/move.c:709:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/move.c:220:7: style: Local variable 'distance' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:1093:5: note: Shadowed declaration omega-rpg-0.90-pa9.orig/move.c:220:7: note: Shadow variable omega-rpg-0.90-pa9.orig/move.c:701:18: style: Variable 'something' is assigned a value that is never used. [unreadVariable] omega-rpg-0.90-pa9.orig/newrand.c:64:28: style: Variable 'mag01' can be declared as const array [constVariable] omega-rpg-0.90-pa9.orig/pdump.c:1178:23: warning: Either the condition 'rank<0' is redundant or the array 'arena_ranks[6]' is accessed at index 6, which is out of bounds. [arrayIndexOutOfBoundsCond] omega-rpg-0.90-pa9.orig/pdump.c:1175:13: note: Assuming that condition 'rank<0' is not redundant omega-rpg-0.90-pa9.orig/pdump.c:1178:23: note: Array index out of bounds omega-rpg-0.90-pa9.orig/pdump.c:1196:24: warning: Either the condition 'rank<0' is redundant or the array 'circle_ranks[6]' is accessed at index 6, which is out of bounds. [arrayIndexOutOfBoundsCond] omega-rpg-0.90-pa9.orig/pdump.c:1193:13: note: Assuming that condition 'rank<0' is not redundant omega-rpg-0.90-pa9.orig/pdump.c:1196:24: note: Array index out of bounds omega-rpg-0.90-pa9.orig/pdump.c:1204:23: warning: Either the condition 'rank<0' is redundant or the array 'order_ranks[6]' is accessed at index 6, which is out of bounds. [arrayIndexOutOfBoundsCond] omega-rpg-0.90-pa9.orig/pdump.c:1201:13: note: Assuming that condition 'rank<0' is not redundant omega-rpg-0.90-pa9.orig/pdump.c:1204:23: note: Array index out of bounds omega-rpg-0.90-pa9.orig/pdump.c:938:10: style: Variable 'curcol' is reassigned a value before the old one has been used. [redundantAssignment] omega-rpg-0.90-pa9.orig/pdump.c:909:10: note: curcol is assigned omega-rpg-0.90-pa9.orig/pdump.c:938:10: note: curcol is overwritten omega-rpg-0.90-pa9.orig/pdump.c:1052:24: portability: Shifting a negative value is technically undefined behaviour [shiftNegativeLHS] omega-rpg-0.90-pa9.orig/pdump.c:209:40: style:inconclusive: Function 'strcat_carry_item' argument 2 names different: declaration 'slotnum' definition 'slot'. [funcArgNamesDifferent] omega-rpg-0.90-pa9.orig/pdump.c:29:40: note: Function 'strcat_carry_item' argument 2 names different: declaration 'slotnum' definition 'slot'. omega-rpg-0.90-pa9.orig/pdump.c:209:40: note: Function 'strcat_carry_item' argument 2 names different: declaration 'slotnum' definition 'slot'. omega-rpg-0.90-pa9.orig/save.c:39:16: style: Local variable 'save' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:169:6: note: Shadowed declaration omega-rpg-0.90-pa9.orig/save.c:39:16: note: Shadow variable omega-rpg-0.90-pa9.orig/save.c:538:9: style: Local variable 'version' shadows outer function [shadowFunction] omega-rpg-0.90-pa9.orig/extern.h:194:6: note: Shadowed declaration omega-rpg-0.90-pa9.orig/save.c:538:9: note: Shadow variable omega-rpg-0.90-pa9.orig/save.c:339:12: error: Shifting 32-bit value by 63 bits is undefined behaviour [shiftTooManyBits] omega-rpg-0.90-pa9.orig/save.c:480:12: error: Shifting 32-bit value by 63 bits is undefined behaviour [shiftTooManyBits] omega-rpg-0.90-pa9.orig/save.c:1288:11: error: Uninitialized variable: mask [uninitvar] omega-rpg-0.90-pa9.orig/save.c:1284:15: note: Assuming condition is false omega-rpg-0.90-pa9.orig/save.c:1288:11: note: Uninitialized variable: mask omega-rpg-0.90-pa9.orig/scr.c:1305:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/scr.c:1308:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/scr.c:1738:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/scr.c:1757:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/scr.c:1776:5: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/scr.c:240:15: style: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch] omega-rpg-0.90-pa9.orig/scr.c:239:18: note: $symbol is assigned omega-rpg-0.90-pa9.orig/scr.c:240:15: note: $symbol is overwritten omega-rpg-0.90-pa9.orig/scr.c:261:15: style: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch] omega-rpg-0.90-pa9.orig/scr.c:260:18: note: $symbol is assigned omega-rpg-0.90-pa9.orig/scr.c:261:15: note: $symbol is overwritten omega-rpg-0.90-pa9.orig/scr.c:282:15: style: Variable 'p' is reassigned a value before the old one has been used. 'break;' missing? [redundantAssignInSwitch] omega-rpg-0.90-pa9.orig/scr.c:281:18: note: $symbol is assigned omega-rpg-0.90-pa9.orig/scr.c:282:15: note: $symbol is overwritten omega-rpg-0.90-pa9.orig/scr.c:1929:10: style: Redundant initialization for 'idchar'. The initialized value is overwritten before it is read. [redundantInitialization] omega-rpg-0.90-pa9.orig/scr.c:1920:30: note: idchar is initialized omega-rpg-0.90-pa9.orig/scr.c:1929:10: note: idchar is overwritten omega-rpg-0.90-pa9.orig/site1.c:343:8: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/site1.c:409:8: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] omega-rpg-0.90-pa9.orig/site2.c:297:55: style: Comparing expression of type 'unsigned int' against value 0. Condition is always false. [compareValueOutOfTypeRangeError] omega-rpg-0.90-pa9.orig/site2.c:297:53: style: Checking if unsigned expression 'Player.alignment+random_range(200)' is less than zero. [unsignedLessThanZero] omega-rpg-0.90-pa9.orig/spell.c:289:32: warning: Either the condition 'x>=0' is redundant or the array 'Level->site[128][64]' is accessed at index Level->site[-1][*], which is out of bounds. [negativeIndex] omega-rpg-0.90-pa9.orig/spell.c:289:13: note: Assuming that condition 'x>=0' is not redundant omega-rpg-0.90-pa9.orig/spell.c:289:32: note: Negative array index omega-rpg-0.90-pa9.orig/spell.c:291:32: warning: Either the condition 'y>=0' is redundant or the array 'Level->site[128][64]' is accessed at index Level->site[*][-1], which is out of bounds. [negativeIndex] omega-rpg-0.90-pa9.orig/spell.c:291:13: note: Assuming that condition 'y>=0' is not redundant omega-rpg-0.90-pa9.orig/spell.c:291:32: note: Negative array index omega-rpg-0.90-pa9.orig/spell.c:293:27: warning: Either the condition 'y>=0' is redundant or the array 'Level->site[128][64]' is accessed at index Level->site[*][-1], which is out of bounds. [negativeIndex] omega-rpg-0.90-pa9.orig/spell.c:291:13: note: Assuming that condition 'y>=0' is not redundant omega-rpg-0.90-pa9.orig/spell.c:293:27: note: Negative array index omega-rpg-0.90-pa9.orig/spell.c:811:15: warning: Either the condition 'pos>0' is redundant or the array 'prefix[80]' is accessed at index -1, which is out of bounds. [negativeIndex] omega-rpg-0.90-pa9.orig/spell.c:809:15: note: Assuming that condition 'pos>0' is not redundant omega-rpg-0.90-pa9.orig/spell.c:810:18: note: pos is decremented', new value is 0 omega-rpg-0.90-pa9.orig/spell.c:811:15: note: Negative array index omega-rpg-0.90-pa9.orig/spell.c:862:17: style: Condition 'first==last' is always false [knownConditionTrueFalse] omega-rpg-0.90-pa9.orig/spell.c:855:13: note: Assuming that condition 'l