2022-06-23 04:36 ftp://ftp.de.debian.org/debian/pool/main/libm/libmpd/libmpd_0.20.0.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --template=daca2 -D__GNUC__ --platform=unix64 -rp=temp -j2 platform: Linux-5.4.0-110-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.24 compiler: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 cppcheck: head 2.8 head-info: f1212e6 (2022-06-22 21:22:04 +0200) count: 32 32 elapsed-time: 2.7 4.2 head-timing-info: Overall time: 0s old-timing-info: Overall time: 0s head results: libmpd-0.20.0/example/testcase/testcase.c:263:11: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] libmpd-0.20.0/src/libmpd-database.c:964:10: warning: Char literal compared with pointer 'path'. Did you intend to dereference it? [charLiteralWithCharPtrCompare] libmpd-0.20.0/src/libmpd-status.c:717:48: style:inconclusive: Boolean expression 'mi->the_status_changed_callback!=NULL' is used in bitwise operation. Did you mean '&&'? [bitwiseOnBoolean] libmpd-0.20.0/src/libmpd-strfsong.c:183:34: style: Expression is always false because 'else if' condition matches previous condition at line 171. [multiCondition] libmpd-0.20.0/src/libmpd-strfsong.c:191:9: style: Local variable 'length' shadows outer variable [shadowVariable] libmpd-0.20.0/src/libmpd-strfsong.c:66:18: note: Shadowed declaration libmpd-0.20.0/src/libmpd-strfsong.c:191:9: note: Shadow variable libmpd-0.20.0/src/libmpd-strfsong.c:203:9: style: Local variable 'i' shadows outer variable [shadowVariable] libmpd-0.20.0/src/libmpd-strfsong.c:67:6: note: Shadowed declaration libmpd-0.20.0/src/libmpd-strfsong.c:203:9: note: Shadow variable libmpd-0.20.0/src/libmpd-strfsong.c:205:21: style: Local variable 'found' shadows outer variable [shadowVariable] libmpd-0.20.0/src/libmpd-strfsong.c:68:12: note: Shadowed declaration libmpd-0.20.0/src/libmpd-strfsong.c:205:21: note: Shadow variable libmpd-0.20.0/src/libmpd-strfsong.c:223:9: style: Local variable 'length' shadows outer variable [shadowVariable] libmpd-0.20.0/src/libmpd-strfsong.c:66:18: note: Shadowed declaration libmpd-0.20.0/src/libmpd-strfsong.c:223:9: note: Shadow variable libmpd-0.20.0/src/libmpd.c:1184:9: error: Common realloc mistake: 'retv' nulled but not freed upon failure [memleakOnRealloc] libmpd-0.20.0/src/libmpd.c:1004:15: warning: Either the condition 'mi->queue!=NULL' is redundant or there is possible null pointer dereference: mi->queue. [nullPointerRedundantCheck] libmpd-0.20.0/src/libmpd.c:1000:18: note: Assuming that condition 'mi->queue!=NULL' is not redundant libmpd-0.20.0/src/libmpd.c:1004:15: note: Null pointer dereference libmpd-0.20.0/src/libmpd.c:689:16: style: Local variable 'retv' shadows outer variable [shadowVariable] libmpd-0.20.0/src/libmpd.c:611:9: note: Shadowed declaration libmpd-0.20.0/src/libmpd.c:689:16: note: Shadow variable libmpd-0.20.0/src/libmpd.c:711:10: style: Variable 'retv' is assigned a value that is never used. [unreadVariable] libmpd-0.20.0/src/libmpdclient.c:439:22: error: Buffer is accessed out of bounds: connection->errorStr [bufferAccessOutOfBounds] libmpd-0.20.0/src/libmpdclient.c:257:10: style: Obsolescent function 'gethostbyname' called. It is recommended to use 'getaddrinfo' instead. [prohibitedgethostbynameCalled] libmpd-0.20.0/src/libmpdclient.c:557:11: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] libmpd-0.20.0/src/libmpdclient.c:638:5: style: Suspicious condition (assignment + comparison); Clarify expression with parentheses. [clarifyCondition] libmpd-0.20.0/src/libmpdclient.c:1234:25: style: Condition 'entity->info.song->genre' is always false [knownConditionTrueFalse] libmpd-0.20.0/src/libmpdclient.c:1232:12: note: Assuming that condition '!entity->info.song->genre' is not redundant libmpd-0.20.0/src/libmpdclient.c:1234:25: note: Condition 'entity->info.song->genre' is always false libmpd-0.20.0/src/libmpdclient.c:1756:2: warning: Either the condition 'output!=NULL' is redundant or there is possible null pointer dereference: output. [nullPointerRedundantCheck] libmpd-0.20.0/src/libmpdclient.c:1763:13: note: Assuming that condition 'output!=NULL' is not redundant libmpd-0.20.0/src/libmpdclient.c:1756:2: note: Null pointer dereference libmpd-0.20.0/src/libmpdclient.c:1764:4: warning: Either the condition 'output!=NULL' is redundant or there is possible null pointer dereference: output. [nullPointerRedundantCheck] libmpd-0.20.0/src/libmpdclient.c:1763:13: note: Assuming that condition 'output!=NULL' is not redundant libmpd-0.20.0/src/libmpdclient.c:1764:4: note: Null pointer dereference libmpd-0.20.0/src/libmpdclient.c:1336:67: style:inconclusive: Function 'mpd_sendPlaylistInfoCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:420:67: note: Function 'mpd_sendPlaylistInfoCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1336:67: note: Function 'mpd_sendPlaylistInfoCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1344:65: style:inconclusive: Function 'mpd_sendPlaylistIdCommand' argument 2 names different: declaration 'songId' definition 'id'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:423:65: note: Function 'mpd_sendPlaylistIdCommand' argument 2 names different: declaration 'songId' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1344:65: note: Function 'mpd_sendPlaylistIdCommand' argument 2 names different: declaration 'songId' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1478:61: style:inconclusive: Function 'mpd_sendDeleteCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:480:61: note: Function 'mpd_sendDeleteCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1478:61: note: Function 'mpd_sendDeleteCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1486:63: style:inconclusive: Function 'mpd_sendDeleteIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:482:63: note: Function 'mpd_sendDeleteIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1486:63: note: Function 'mpd_sendDeleteIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1546:59: style:inconclusive: Function 'mpd_sendPlayCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:500:59: note: Function 'mpd_sendPlayCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1546:59: note: Function 'mpd_sendPlayCommand' argument 2 names different: declaration 'songNum' definition 'songPos'. libmpd-0.20.0/src/libmpdclient.c:1554:61: style:inconclusive: Function 'mpd_sendPlayIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:502:61: note: Function 'mpd_sendPlayIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1554:61: note: Function 'mpd_sendPlayIdCommand' argument 2 names different: declaration 'songNum' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1586:61: style:inconclusive: Function 'mpd_sendMoveIdCommand' argument 2 names different: declaration 'from' definition 'id'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:514:61: note: Function 'mpd_sendMoveIdCommand' argument 2 names different: declaration 'from' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1586:61: note: Function 'mpd_sendMoveIdCommand' argument 2 names different: declaration 'from' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1602:61: style:inconclusive: Function 'mpd_sendSwapIdCommand' argument 2 names different: declaration 'song1' definition 'id1'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:518:61: note: Function 'mpd_sendSwapIdCommand' argument 2 names different: declaration 'song1' definition 'id1'. libmpd-0.20.0/src/libmpdclient.c:1602:61: note: Function 'mpd_sendSwapIdCommand' argument 2 names different: declaration 'song1' definition 'id1'. libmpd-0.20.0/src/libmpdclient.c:1602:70: style:inconclusive: Function 'mpd_sendSwapIdCommand' argument 3 names different: declaration 'song2' definition 'id2'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:518:72: note: Function 'mpd_sendSwapIdCommand' argument 3 names different: declaration 'song2' definition 'id2'. libmpd-0.20.0/src/libmpdclient.c:1602:70: note: Function 'mpd_sendSwapIdCommand' argument 3 names different: declaration 'song2' definition 'id2'. libmpd-0.20.0/src/libmpdclient.c:1618:61: style:inconclusive: Function 'mpd_sendSeekIdCommand' argument 2 names different: declaration 'song' definition 'id'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:522:61: note: Function 'mpd_sendSeekIdCommand' argument 2 names different: declaration 'song' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:1618:61: note: Function 'mpd_sendSeekIdCommand' argument 2 names different: declaration 'song' definition 'id'. libmpd-0.20.0/src/libmpdclient.c:2080:70: style:inconclusive: Function 'mpd_sendGetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:693:70: note: Function 'mpd_sendGetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. libmpd-0.20.0/src/libmpdclient.c:2080:70: note: Function 'mpd_sendGetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. libmpd-0.20.0/src/libmpdclient.c:2093:69: style:inconclusive: Function 'mpd_sendSetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. [funcArgNamesDifferent] libmpd-0.20.0/src/libmpdclient.h:692:69: note: Function 'mpd_sendSetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. libmpd-0.20.0/src/libmpdclient.c:2093:69: note: Function 'mpd_sendSetSongSticker' argument 2 names different: declaration 'song' definition 'song_path'. libmpd-0.20.0/src/libmpdclient.c:157:65: error: Uninitialized variable: valopt [uninitvar] diff: DONE