2022-06-25 03:10 ftp://ftp.de.debian.org/debian/pool/main/s/samtools/samtools_1.14.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 -j4 platform: Linux-5.10.0-15-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: 11860cc (2022-06-24 13:55:04 +0200) count: 163 160 elapsed-time: 8.3 13.5 head-timing-info: Overall time: 0s old-timing-info: Overall time: 0s head results: samtools-1.14/bam2bcf_indel.c:35:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_SET_INIT_STR is a macro then please configure it. [unknownMacro] samtools-1.14/amplicon_stats.c:53:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_MAP_INIT_INT64 is a macro then please configure it. [unknownMacro] samtools-1.14/bam.c:35:40: style:inconclusive: Function 'bam_get_library' argument 1 names different: declaration 'header' definition 'h'. [funcArgNamesDifferent] samtools-1.14/bam.h:32:40: note: Function 'bam_get_library' argument 1 names different: declaration 'header' definition 'h'. samtools-1.14/bam.c:35:40: note: Function 'bam_get_library' argument 1 names different: declaration 'header' definition 'h'. samtools-1.14/bam2depth.c:495:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_MAP_INIT_STR is a macro then please configure it. [unknownMacro] samtools-1.14/bam_addrprg.c:199:9: warning: Conversion of char literal 'O' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_addrprg.c:199:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_cat.c:501:21: error: Common realloc mistake: 'infns' nulled but not freed upon failure [memleakOnRealloc] samtools-1.14/bam_cat.c:530:9: error: Common realloc mistake: 'infns' nulled but not freed upon failure [memleakOnRealloc] samtools-1.14/bam_cat.c:467:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_cat.c:467:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_import.c:424:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_import.c:424:9: warning: Conversion of char literal 'O' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_import.c:424:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_import.c:363:14: error: Uninitialized variable: res [uninitvar] samtools-1.14/bam_import.c:290:23: note: Assuming condition is false samtools-1.14/bam_import.c:363:14: note: Uninitialized variable: res samtools-1.14/bam_index.c:125:35: warning: Either the condition '!count0' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck] samtools-1.14/bam_index.c:126:9: note: Assuming that condition '!count0' is not redundant samtools-1.14/bam_index.c:125:35: note: Null pointer addition samtools-1.14/bam_index.c:183:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_index.c:183:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_lpileup.c:42:1: error: There is an unknown macro here somewhere. Configuration is required. If KSORT_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bam_markdup.c:192:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bam_fastq.c:563:33: error: Array 'state->fpi[3]' accessed at index -3, which is out of bounds. [negativeIndex] samtools-1.14/bam_fastq.c:557:9: note: After for loop, j has value 3 samtools-1.14/bam_fastq.c:560:14: note: Compound assignment '-=', assigned value is 0 samtools-1.14/bam_fastq.c:560:14: note: Compound assignment '-=', assigned value is -3 samtools-1.14/bam_fastq.c:563:15: note: Assuming that condition 'j==i' is not redundant samtools-1.14/bam_fastq.c:563:33: note: Negative array index samtools-1.14/bam_fastq.c:373:28: portability: Undefined behaviour, when 'l' is 4 the pointer arithmetic 'fn+l' is out of bounds. [pointerOutOfBoundsCond] samtools-1.14/bam_fastq.c:373:12: note: Assuming that condition 'l>3' is not redundant samtools-1.14/bam_fastq.c:373:28: note: Pointer arithmetic overflow samtools-1.14/bam_fastq.c:374:28: portability: Undefined behaviour, when 'l' is 5 the pointer arithmetic 'fn+l' is out of bounds. [pointerOutOfBoundsCond] samtools-1.14/bam_fastq.c:374:12: note: Assuming that condition 'l>4' is not redundant samtools-1.14/bam_fastq.c:374:28: note: Pointer arithmetic overflow samtools-1.14/bam_fastq.c:375:28: portability: Undefined behaviour, when 'l' is 6 the pointer arithmetic 'fn+l' is out of bounds. [pointerOutOfBoundsCond] samtools-1.14/bam_fastq.c:375:12: note: Assuming that condition 'l>5' is not redundant samtools-1.14/bam_fastq.c:375:28: note: Pointer arithmetic overflow samtools-1.14/bam_fastq.c:201:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_fastq.c:201:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_mate.c:150:15: style: Redundant initialization for 'first'. The initialized value is overwritten before it is read. [redundantInitialization] samtools-1.14/bam_mate.c:145:19: note: first is initialized samtools-1.14/bam_mate.c:150:15: note: first is overwritten samtools-1.14/bam_mate.c:151:16: style: Redundant initialization for 'second'. The initialized value is overwritten before it is read. [redundantInitialization] samtools-1.14/bam_mate.c:146:20: note: second is initialized samtools-1.14/bam_mate.c:151:16: note: second is overwritten samtools-1.14/bam_mate.c:147:49: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] samtools-1.14/bam_mate.c:148:50: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation] samtools-1.14/bam_mate.c:437:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_mate.c:437:9: warning: Conversion of char literal 'O' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_mate.c:437:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam2bcf.c:679:19: debug: Wrong data detected by condition !tok->next()->astOperand1() [DacaWrongData] samtools-1.14/bam2bcf.c:437:16: style: Expression 'log(1 + x)' can be replaced by 'log1p(x)' to avoid loss of precision. [unpreciseMathCall] samtools-1.14/bam2bcf.c:439:16: style: Expression 'log(1 + x)' can be replaced by 'log1p(x)' to avoid loss of precision. [unpreciseMathCall] samtools-1.14/bam2bcf.c:207:23: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] samtools-1.14/bam2bcf.c:211:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] samtools-1.14/bam2bcf.c:213:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] samtools-1.14/bam2bcf.c:215:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] samtools-1.14/bam2bcf.c:677:42: style:inconclusive: Function 'bcf_call2bcf' argument 2 names different: declaration 'b' definition 'rec'. [funcArgNamesDifferent] samtools-1.14/bam2bcf.h:130:46: note: Function 'bcf_call2bcf' argument 2 names different: declaration 'b' definition 'rec'. samtools-1.14/bam2bcf.c:677:42: note: Function 'bcf_call2bcf' argument 2 names different: declaration 'b' definition 'rec'. samtools-1.14/bam2bcf.c:613:21: style: Local variable 'tmp' shadows outer variable [shadowVariable] samtools-1.14/bam2bcf.c:526:21: note: Shadowed declaration samtools-1.14/bam2bcf.c:613:21: note: Shadow variable samtools-1.14/bam2bcf.c:267:22: style: Parameter 'pos' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:330:29: style: Parameter 'a' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:330:37: style: Parameter 'b' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:371:31: style: Parameter 'a' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:371:39: style: Parameter 'b' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:404:27: style: Parameter 'a' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:404:35: style: Parameter 'b' can be declared as pointer to const [constParameter] samtools-1.14/bam2bcf.c:588:32: error: Uninitialized variable: g [uninitvar] samtools-1.14/bam2bcf.c:576:27: note: Assuming condition is false samtools-1.14/bam2bcf.c:588:32: note: Uninitialized variable: g samtools-1.14/bam_ampliconclip.c:891:13: warning: Either the condition '(stats_fp=fopen(param->stats_file,"w"))==NULL' is redundant or there is possible null pointer dereference: stats_fp. [nullPointerRedundantCheck] samtools-1.14/bam_ampliconclip.c:884:56: note: Assuming that condition '(stats_fp=fopen(param->stats_file,"w"))==NULL' is not redundant samtools-1.14/bam_ampliconclip.c:891:13: note: Null pointer dereference samtools-1.14/bam_ampliconclip.c:401:18: style: Local variable 'i' shadows outer variable [shadowVariable] samtools-1.14/bam_ampliconclip.c:292:14: note: Shadowed declaration samtools-1.14/bam_ampliconclip.c:401:18: note: Shadow variable samtools-1.14/bam_ampliconclip.c:959:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_ampliconclip.c:959:9: warning: Conversion of char literal 'O' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_ampliconclip.c:959:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_md.c:250:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_md.c:250:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_rmdup.c:41:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_SET_INIT_STR is a macro then please configure it. [unknownMacro] samtools-1.14/bam_rmdupse.c:45:1: error: There is an unknown macro here somewhere. Configuration is required. If KLIST_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bam_samples.c:37:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_MAP_INIT_STR is a macro then please configure it. [unknownMacro] samtools-1.14/bam_sort.c:95:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bam_split.c:490:17: style: Local variable 'i' shadows outer variable [shadowVariable] samtools-1.14/bam_split.c:446:12: note: Shadowed declaration samtools-1.14/bam_split.c:490:17: note: Shadow variable samtools-1.14/bam_split.c:110:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_split.c:110:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_tview.h:42:1: error: There is an unknown macro here somewhere. Configuration is required. If KHASH_MAP_INIT_STR is a macro then please configure it. [unknownMacro] samtools-1.14/bamshuf.c:84:1: error: There is an unknown macro here somewhere. Configuration is required. If KSORT_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bam_stat.c:287:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_stat.c:287:9: warning: Conversion of char literal 'O' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_stat.c:287:9: warning: Conversion of char literal '@' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/bam_quickcheck.c:157:17: style: Local variable 'ret' shadows outer variable [shadowVariable] samtools-1.14/bam_quickcheck.c:119:9: note: Shadowed declaration samtools-1.14/bam_quickcheck.c:157:17: note: Shadow variable samtools-1.14/bedcov.c:41:1: error: There is an unknown macro here somewhere. Configuration is required. If KSTREAM_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/bedidx.c:45:1: error: There is an unknown macro here somewhere. Configuration is required. If KSORT_INIT_STATIC is a macro then please configure it. [unknownMacro] samtools-1.14/cut_target.c:231:17: error: Common realloc mistake: 'cns' nulled but not freed upon failure [memleakOnRealloc] samtools-1.14/cut_target.c:71:13: style: Local variable 'q' shadows outer variable [shadowVariable] samtools-1.14/cut_target.c:62:11: note: Shadowed declaration samtools-1.14/cut_target.c:71:13: note: Shadow variable samtools-1.14/cut_target.c:95:71: style: Parameter 'cns' can be declared as pointer to const [constParameter] samtools-1.14/cut_target.c:182:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/cut_target.c:182:9: warning: Conversion of char literal 'f' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/dict.c:35:1: error: There is an unknown macro here somewhere. Configuration is required. If KSEQ_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/coverage.c:257:21: warning: %i in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] samtools-1.14/coverage.c:258:79: warning: %i in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] samtools-1.14/coverage.c:553:5: warning: Size of pointer 'n_plp' used instead of size of its data. [pointerSize] samtools-1.14/coverage.c:324:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/misc/ace2sam.c:35:1: error: There is an unknown macro here somewhere. Configuration is required. If KSTREAM_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/misc/maq2sam.c:174:9: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] samtools-1.14/misc/md5fa.c:32:1: error: There is an unknown macro here somewhere. Configuration is required. If KSEQ_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/misc/wgsim.c:46:1: error: There is an unknown macro here somewhere. Configuration is required. If KSEQ_INIT is a macro then please configure it. [unknownMacro] samtools-1.14/lz4/lz4.c:567:29: style:inconclusive: Boolean expression 'ip>anchor' is used in bitwise operation. Did you mean '&&'? [bitwiseOnBoolean] samtools-1.14/lz4/lz4.c:1159:65: style:inconclusive: Boolean expression '(endOnInput?(ipnext()->astOperand1() [DacaWrongData] samtools-1.14/bam_plcmd.c:479:17: debug: Wrong data detected by condition !tok->next()->astOperand1() [DacaWrongData] samtools-1.14/bam_plcmd.c:1436:40: warning: fscanf() without field width limits can crash with huge input data. [invalidscanf] samtools-1.14/bam_plcmd.c:1131:9: error: Common realloc mistake: 'files' nulled but not freed upon failure [memleakOnRealloc] samtools-1.14/bam_plcmd.c:1380:104: error: Memory leak: mplp.reg [memleak] samtools-1.14/bam_plcmd.c:1436:30: warning:inconclusive: Either the condition '(fp_rg=fopen(optarg,"r"))==NULL' is redundant or there is possible null pointer dereference: fp_rg. [nullPointerRedundantCheck] samtools-1.14/bam_plcmd.c:1434:50: note: Assuming that condition '(fp_rg=fopen(optarg,"r"))==NULL' is not redundant samtools-1.14/bam_plcmd.c:1436:30: note: Null pointer dereference samtools-1.14/bam_plcmd.c:98:21: style: Local variable 'j' shadows outer variable [shadowVariable] samtools-1.14/bam_plcmd.c:74:9: note: Shadowed declaration samtools-1.14/bam_plcmd.c:98:21: note: Shadow variable samtools-1.14/bam_plcmd.c:858:25: style: Local variable 'n' shadows outer argument [shadowArgument] samtools-1.14/bam_plcmd.c:476:43: note: Shadowed declaration samtools-1.14/bam_plcmd.c:858:25: note: Shadow variable samtools-1.14/bam_plcmd.c:966:43: warning:inconclusive: Found suspicious operator '*', result is not used. [constStatement] samtools-1.14/bam_plcmd.c:443:52: style: Parameter 'n_plp' can be declared as pointer to const [constParameter] samtools-1.14/bam_plcmd.c:1276:9: warning: Conversion of char literal '-' to bool always evaluates to true. [incorrectCharBooleanError] samtools-1.14/test/test.c:43:9: error: Return value of allocation function 'freopen' is not stored. [leakReturnValNotUsed] samtools-1.14/tmp_file.c:108:9: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] samtools-1.14/test/split/test_filter_header_rg.c:227:9: style: The if condition is the same as the previous if condition [duplicateCondition] samtools-1.14/test/split/test_filter_header_rg.c:225:9: note: First condition samtools-1.14/test/split/test_filter_header_rg.c:227:9: note: Second condition samtools-1.14/test/split/test_filter_header_rg.c:270:9: style: The if condition is the same as the previous if condition [duplicateCondition] samtools-1.14/test/split/test_filter_header_rg.c:268:9: note: First condition samtools-1.14/test/split/test_filter_header_rg.c:270:9: note: Second condition diff: head samtools-1.14/bam2bcf.c:207:23: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] head samtools-1.14/bam2bcf.c:211:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] head samtools-1.14/bam2bcf.c:213:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] head samtools-1.14/bam2bcf.c:215:32: warning: Operator '|' with one operand equal to zero is redundant. [badBitmaskCheck] head samtools-1.14/bam2bcf.c:267:22: style: Parameter 'pos' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:267:22: style: Parameter 'pos' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:330:29: style: Parameter 'a' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:330:29: style: Parameter 'a' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:330:37: style: Parameter 'b' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:330:37: style: Parameter 'b' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:371:31: style: Parameter 'a' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:371:31: style: Parameter 'a' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:371:39: style: Parameter 'b' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:371:39: style: Parameter 'b' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:404:27: style: Parameter 'a' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:404:27: style: Parameter 'a' can be declared with const [constParameter] head samtools-1.14/bam2bcf.c:404:35: style: Parameter 'b' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam2bcf.c:404:35: style: Parameter 'b' can be declared with const [constParameter] head samtools-1.14/bam_plcmd.c:443:52: style: Parameter 'n_plp' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/bam_plcmd.c:443:52: style: Parameter 'n_plp' can be declared with const [constParameter] head samtools-1.14/cut_target.c:95:71: style: Parameter 'cns' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/cut_target.c:95:71: style: Parameter 'cns' can be declared with const [constParameter] 2.8 samtools-1.14/lz4/lz4.c:1133:56: error: Pointer addition with NULL pointer. [nullPointerArithmetic] samtools-1.14/lz4/lz4.c:1475:128: note: Calling function 'LZ4_decompress_generic', 10th argument 'NULL' value is 0 samtools-1.14/lz4/lz4.c:1133:56: note: Null pointer addition head samtools-1.14/sam_utils.c:41:33: style: Parameter 'fp' can be declared as pointer to const [constParameter] 2.8 samtools-1.14/sam_utils.c:41:33: style: Parameter 'fp' can be declared with const [constParameter] DONE