2024-04-14 05:39 ftp://ftp.de.debian.org/debian/pool/main/x/xsoldier/xsoldier_1.8.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=motif --library=sdl --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning -D__GNUC__ --platform=unix64 -j1 platform: Linux-5.15.0-102-generic-x86_64-with-glibc2.35 python: 3.10.12 client-version: 1.3.55 compiler: g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 cppcheck: head 2.13.0 head-info: 01c049d (2024-04-13 21:28:19 +0200) count: 44 26 elapsed-time: 4.7 4.2 head-timing-info: old-timing-info: head results: xsoldier-1.8/boss.c:139:39: style: Parameter 'your' can be declared as pointer to const. However it seems that 'BossHit1' is a callback function, if 'your' is declared with const you might also need to cast function pointer(s). [constParameterCallback] xsoldier-1.8/boss.c:834:35: note: You might need to cast the function pointer here xsoldier-1.8/boss.c:139:39: note: Parameter 'your' can be declared as pointer to const xsoldier-1.8/boss.c:1018:39: style: Parameter 'your' can be declared as pointer to const. However it seems that 'BossHit8' is a callback function, if 'your' is declared with const you might also need to cast function pointer(s). [constParameterCallback] xsoldier-1.8/boss.c:929:35: note: You might need to cast the function pointer here xsoldier-1.8/boss.c:1018:39: note: Parameter 'your' can be declared as pointer to const xsoldier-1.8/callback.c:25:25: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:33:25: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:33:38: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:39:28: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:39:41: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:45:27: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:45:40: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:52:40: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:79:45: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:108:24: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/callback.c:108:37: style: Parameter 'grp' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/common.c:98:24: style: Condition 'uw>0' is always true [knownConditionTrueFalse] xsoldier-1.8/common.c:97:9: note: Assuming that condition '!uw' is not redundant xsoldier-1.8/common.c:98:24: note: Condition 'uw>0' is always true xsoldier-1.8/ending.c:130:23: style: Variable 'len' is assigned a value that is never used. [unreadVariable] xsoldier-1.8/enemy.c:96:40: style: Parameter 'your' can be declared as pointer to const. However it seems that 'EnemyHit1' is a callback function, if 'your' is declared with const you might also need to cast function pointer(s). [constParameterCallback] xsoldier-1.8/enemy.c:549:36: note: You might need to cast the function pointer here xsoldier-1.8/enemy.c:96:40: note: Parameter 'your' can be declared as pointer to const xsoldier-1.8/game.c:517:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/game.c:199:59: style: Argument '(lrand48()%FieldW)+1,0' to function NewEnemy is always 0. It does not matter what value 'FieldW' has. [knownArgument] xsoldier-1.8/game.c:83:9: style: Variable 'StageObj' can be declared as const array [constVariable] xsoldier-1.8/graphic.c:109:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/graphic.c:339:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/image.c:65:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XpmColormap [valueFlowBailoutIncompleteVar] xsoldier-1.8/image.c:233:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable pixmap [valueFlowBailoutIncompleteVar] xsoldier-1.8/input.c:61:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_Up [valueFlowBailoutIncompleteVar] xsoldier-1.8/input.c:229:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_space [valueFlowBailoutIncompleteVar] xsoldier-1.8/input.c:297:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_space [valueFlowBailoutIncompleteVar] xsoldier-1.8/input.c:319:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_Up [valueFlowBailoutIncompleteVar] xsoldier-1.8/input.c:352:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_Up [valueFlowBailoutIncompleteVar] xsoldier-1.8/main.c:87:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/main.c:174:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/main.c:361:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/main.c:402:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ITIMER_REAL [valueFlowBailoutIncompleteVar] xsoldier-1.8/main.c:177:17: portability: %d in format string (no. 1) requires 'int' but the argument type is 'size_t {aka unsigned long}'. [invalidPrintfArgType_sint] xsoldier-1.8/manage.c:386:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] xsoldier-1.8/manage.c:375:13: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] xsoldier-1.8/manage.c:202:23: style: Condition 'manage->Level<0' is always false [knownConditionTrueFalse] xsoldier-1.8/manage.c:199:21: note: Assignment 'manage->Level=10', assigned value is 10 xsoldier-1.8/manage.c:202:23: note: Condition 'manage->Level<0' is always false xsoldier-1.8/manage.c:369:20: style: Variable 'pw' can be declared as pointer to const [constVariablePointer] xsoldier-1.8/manage.c:397:13: error: Memory is allocated but not initialized: New [uninitdata] xsoldier-1.8/opening.c:43:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable DATADIR [valueFlowBailoutIncompleteVar] xsoldier-1.8/score.c:44:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable BUFSIZ [valueFlowBailoutIncompleteVar] xsoldier-1.8/score.c:221:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LOCALSTATEDIR [valueFlowBailoutIncompleteVar] xsoldier-1.8/score.c:214:30: style: Parameter 'p' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/score.c:264:47: style: Parameter 'rec' can be declared as pointer to const [constParameterPointer] xsoldier-1.8/star.c:60:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] diff: head xsoldier-1.8/callback.c:108:24: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:108:37: style: Parameter 'grp' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:25:25: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:33:25: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:33:38: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:39:28: style: Parameter 'my' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:39:41: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/callback.c:45:40: style: Parameter 'your' can be declared as pointer to const [constParameterPointer] head xsoldier-1.8/graphic.c:339:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head xsoldier-1.8/image.c:233:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable pixmap [valueFlowBailoutIncompleteVar] head xsoldier-1.8/input.c:229:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_space [valueFlowBailoutIncompleteVar] head xsoldier-1.8/input.c:297:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_space [valueFlowBailoutIncompleteVar] head xsoldier-1.8/input.c:319:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_Up [valueFlowBailoutIncompleteVar] head xsoldier-1.8/input.c:352:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable XK_Up [valueFlowBailoutIncompleteVar] head xsoldier-1.8/main.c:174:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head xsoldier-1.8/main.c:361:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] head xsoldier-1.8/main.c:402:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable ITIMER_REAL [valueFlowBailoutIncompleteVar] head xsoldier-1.8/score.c:221:19: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LOCALSTATEDIR [valueFlowBailoutIncompleteVar] DONE