2025-05-06 00:02 ftp://ftp.de.debian.org/debian/pool/main/libs/libspng/libspng_0.7.4.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=zlib --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j1 platform: Linux-6.8.0-59-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0 cppcheck: head 2.17.0 head-info: 581f101 (2025-05-05 21:13:30 +0200) count: 109 108 elapsed-time: 40.8 41.0 head-timing-info: old-timing-info: head results: libspng-0.7.4/examples/example.c:14:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_CTX_ENCODER [valueFlowBailoutIncompleteVar] libspng-0.7.4/examples/example.c:142:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_ECHUNKAVAIL [valueFlowBailoutIncompleteVar] libspng-0.7.4/examples/example.c:246:15: style: Variable 'type_str' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:426:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:569:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:690:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:707:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:835:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:1293:22: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:2775:48: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:3635:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:4754:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:4910:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/spng/spng.c:1113:12: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] libspng-0.7.4/spng/spng.c:1107:8: note: If condition 'ret' is true, the function will return/exit libspng-0.7.4/spng/spng.c:1113:12: note: Returning identical expression 'ret' libspng-0.7.4/spng/spng.c:574:12: style: Condition 'res<15' is always false [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:570:15: note: Assignment 'res=res*width', assigned value is greater than -1 libspng-0.7.4/spng/spng.c:572:5: note: Compound assignment '+=', assigned value is 14 libspng-0.7.4/spng/spng.c:574:12: note: Condition 'res<15' is always false libspng-0.7.4/spng/spng.c:3676:26: style: Condition 'scanline_buf_size<32' is always false [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:3672:63: note: Assignment 'scanline_buf_size=ctx->subimage[ctx->widest_pass].scanline_width', assigned value is greater than -1 libspng-0.7.4/spng/spng.c:3674:5: note: Compound assignment '+=', assigned value is 31 libspng-0.7.4/spng/spng.c:3676:26: note: Condition 'scanline_buf_size<32' is always false libspng-0.7.4/spng/spng.c:3754:29: style: Condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE_ALPHA' is always false [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:3752:53: note: Assuming that condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE' is not redundant libspng-0.7.4/spng/spng.c:3754:29: note: Condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE_ALPHA' is always false libspng-0.7.4/spng/spng.c:3756:33: style: Condition 'ihdr->bit_depth<=8' is always true [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:3752:101: note: Assuming that condition 'ihdr->bit_depth<=8' is not redundant libspng-0.7.4/spng/spng.c:3756:33: note: Condition 'ihdr->bit_depth<=8' is always true libspng-0.7.4/spng/spng.c:3760:29: style: Condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE_ALPHA' is always false [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:3758:54: note: Assuming that condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE' is not redundant libspng-0.7.4/spng/spng.c:3760:29: note: Condition 'ihdr->color_type==SPNG_COLOR_TYPE_GRAYSCALE_ALPHA' is always false libspng-0.7.4/spng/spng.c:3762:33: style: Condition 'ihdr->bit_depth==16' is always true [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:3758:102: note: Assuming that condition 'ihdr->bit_depth==16' is not redundant libspng-0.7.4/spng/spng.c:3762:33: note: Condition 'ihdr->bit_depth==16' is always true libspng-0.7.4/spng/spng.c:4806:26: style: Condition 'scanline_buf_size<32' is always false [knownConditionTrueFalse] libspng-0.7.4/spng/spng.c:4802:63: note: Assignment 'scanline_buf_size=ctx->subimage[ctx->widest_pass].scanline_width', assigned value is greater than -1 libspng-0.7.4/spng/spng.c:4804:5: note: Compound assignment '+=', assigned value is 31 libspng-0.7.4/spng/spng.c:4806:26: note: Condition 'scanline_buf_size<32' is always false libspng-0.7.4/spng/spng.c:5160:68: style:inconclusive: Function 'spng_set_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. [funcArgNamesDifferent] libspng-0.7.4/spng/spng.h:455:77: note: Function 'spng_set_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. libspng-0.7.4/spng/spng.c:5160:68: note: Function 'spng_set_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. libspng-0.7.4/spng/spng.c:5171:70: style:inconclusive: Function 'spng_get_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. [funcArgNamesDifferent] libspng-0.7.4/spng/spng.h:456:79: note: Function 'spng_get_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. libspng-0.7.4/spng/spng.c:5171:70: note: Function 'spng_get_chunk_limits' argument 3 names different: declaration 'cache_size' definition 'cache_limit'. libspng-0.7.4/spng/spng.c:5419:60: style:inconclusive: Function 'spng_get_chrm_int' argument 2 names different: declaration 'chrm_int' definition 'chrm'. [funcArgNamesDifferent] libspng-0.7.4/spng/spng.h:488:69: note: Function 'spng_get_chrm_int' argument 2 names different: declaration 'chrm_int' definition 'chrm'. libspng-0.7.4/spng/spng.c:5419:60: note: Function 'spng_get_chrm_int' argument 2 names different: declaration 'chrm_int' definition 'chrm'. libspng-0.7.4/spng/spng.c:589:23: style: Variable 'ihdr' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:748:49: style: Parameter 'chunk' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:997:19: style: Variable 'iend_chunk' can be declared as const array [constVariable] libspng-0.7.4/spng/spng.c:1218:73: style: Parameter 'options' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:1790:47: style: Parameter 'ihdr' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:2249:35: style: Parameter 'type' can be declared as const array [constParameter] libspng-0.7.4/spng/spng.c:2740:32: style: Variable 'keyword_nul' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:3297:27: style: Variable 'ri' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:3302:20: style: Variable 'trns_px' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:4009:33: style: Parameter 'ctx' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:4568:27: style: Variable 'ri' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:4825:27: style: Variable 'sub' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:5038:59: style: Parameter 'data' can be declared as pointer to const. However it seems that 'file_write_fn' is a callback function, if 'data' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libspng-0.7.4/spng/spng.c:5108:58: note: You might need to cast the function pointer here libspng-0.7.4/spng/spng.c:5038:59: note: Parameter 'data' can be declared as pointer to const libspng-0.7.4/spng/spng.c:5150:37: style: Parameter 'ctx' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5171:37: style: Parameter 'ctx' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5440:15: style: Variable 'gama' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/spng/spng.c:5604:52: style: Parameter 'ihdr' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5621:52: style: Parameter 'plte' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5639:52: style: Parameter 'trns' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5671:52: style: Parameter 'chrm' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5696:60: style: Parameter 'chrm_int' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5742:52: style: Parameter 'iccp' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5760:52: style: Parameter 'sbit' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5870:52: style: Parameter 'bkgd' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5900:52: style: Parameter 'hist' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5914:52: style: Parameter 'phys' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5958:52: style: Parameter 'time' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:6011:52: style: Parameter 'offs' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:6025:52: style: Parameter 'exif' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/spng/spng.c:5280:49: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour. See condition at line 5280. [shiftTooManyBitsSigned] libspng-0.7.4/spng/spng.c:5280:15: note: Assuming that condition 'option<32' is not redundant libspng-0.7.4/spng/spng.c:5280:49: note: Shift libspng-0.7.4/spng/spng.c:211:19: style: union member 'spng__decode_plte::rgb' is never used. [unusedStructMember] libspng-0.7.4/spng/spng.c:213:14: style: union member 'spng__decode_plte::align_this' is never used. [unusedStructMember] libspng-0.7.4/spng/spng.c:1393:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/spng/spng.c:4710:13: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/fuzz_main.c:17:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/spng_write_fuzzer.c:72:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SIZE_MAX [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/spng_write_fuzzer.c:61:20: style: Variable 'img' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/tests/target_clones.c:10:11: style: Variable 'y' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/target_clones.c:10:9: style: Variable 'y' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/test.cpp:14:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable cout [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/test_spng.h:20:31: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_COLOR_TYPE_TRUECOLOR [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/test_spng.h:60:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_KEEP_UNKNOWN_CHUNKS [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/test_spng.h:128:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_FMT_PNG [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/test_png.h:86:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable png_bytep [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:46:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_DECODE_TRNS [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:101:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_FMT_PNG [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:394:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_ECHUNKAVAIL [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:496:41: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PNG_INFO_PLTE [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1054:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_FMT_PNG [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1113:50: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1174:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_CTX_ENCODER [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1312:31: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_COLOR_TYPE_GRAYSCALE [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1397:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_IO_EOF [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:1439:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SPNG_CTX_ENCODER [valueFlowBailoutIncompleteVar] libspng-0.7.4/tests/testsuite.c:581:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:621:25: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:752:9: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:762:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:768:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:776:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:782:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:832:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:866:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:872:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:878:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:897:21: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:897:21: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:962:9: warning: %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:972:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/testsuite.c:978:17: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] libspng-0.7.4/tests/test_png.h:27:23: style: Local variable 'state' shadows outer variable [shadowVariable] libspng-0.7.4/tests/test_png.h:23:25: note: Shadowed declaration libspng-0.7.4/tests/test_png.h:27:23: note: Shadow variable libspng-0.7.4/tests/testsuite.c:1395:23: style: Local variable 'state' shadows outer variable [shadowVariable] libspng-0.7.4/tests/test_png.h:23:25: note: Shadowed declaration libspng-0.7.4/tests/testsuite.c:1395:23: note: Shadow variable libspng-0.7.4/tests/testsuite.c:1512:22: style: Local variable 'state' shadows outer variable [shadowVariable] libspng-0.7.4/tests/test_png.h:23:25: note: Shadowed declaration libspng-0.7.4/tests/testsuite.c:1512:22: note: Shadow variable libspng-0.7.4/tests/testsuite.c:30:53: style: Parameter 'test_case' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/tests/testsuite.c:32:11: style: Variable 'type' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/tests/testsuite.c:307:31: style: Variable 'issue_str' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/tests/testsuite.c:1097:31: style: Parameter 'buf' can be declared as pointer to const [constParameterPointer] libspng-0.7.4/tests/testsuite.c:1282:11: style: Variable 'filename' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/tests/testsuite.c:1311:15: style: Variable 'clr_type_str' can be declared as pointer to const [constVariablePointer] libspng-0.7.4/tests/testsuite.c:1392:66: style: Parameter 'data' can be declared as pointer to const. However it seems that 'stream_write_checked' is a callback function, if 'data' is declared with const you might also need to cast function pointer(s). [constParameterCallback] libspng-0.7.4/tests/testsuite.c:1514:30: note: You might need to cast the function pointer here libspng-0.7.4/tests/testsuite.c:1392:66: note: Parameter 'data' can be declared as pointer to const libspng-0.7.4/tests/testsuite.c:91:19: style: Variable 'px_ofs' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/testsuite.c:94:23: style: Variable 'red_diff' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/testsuite.c:94:39: style: Variable 'green_diff' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/testsuite.c:94:54: style: Variable 'blue_diff' is assigned a value that is never used. [unreadVariable] libspng-0.7.4/tests/testsuite.c:94:71: style: Variable 'sample_diff' is assigned a value that is never used. [unreadVariable] diff: head libspng-0.7.4/tests/target_clones.c:10:9: style: Variable 'y' is assigned a value that is never used. [unreadVariable] DONE