2022-06-29 13:44 ftp://ftp.de.debian.org/debian/pool/main/libr/librasterlite/librasterlite_1.1g.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 -j10 platform: Linux-5.18.6-1-MANJARO-x86_64-with-glibc2.35 python: 3.10.5 client-version: 1.3.25 compiler: g++ (GCC) 12.1.0 cppcheck: head 2.8 head-info: 06b408e (2022-06-29 13:43:17 +0200) count: 33 33 elapsed-time: 0.9 1.2 head-timing-info: Overall time: 0s old-timing-info: Overall time: 0s head results: librasterlite-1.1g/lib/rasterlite_jpeg.c:129:4: style: Statements following return, break, continue, goto or throw will never be executed. [unreachableCode] librasterlite-1.1g/lib/rasterlite_png.c:556:14: style: Redundant initialization for 'ptpixels'. The initialized value is overwritten before it is read. [redundantInitialization] librasterlite-1.1g/lib/rasterlite_png.c:505:20: note: ptpixels is initialized librasterlite-1.1g/lib/rasterlite_png.c:556:14: note: ptpixels is overwritten librasterlite-1.1g/lib/rasterlite_png.c:642:14: style: Redundant initialization for 'ptpixels'. The initialized value is overwritten before it is read. [redundantInitialization] librasterlite-1.1g/lib/rasterlite_png.c:590:20: note: ptpixels is initialized librasterlite-1.1g/lib/rasterlite_png.c:642:14: note: ptpixels is overwritten librasterlite-1.1g/lib/rasterlite_image.c:558:9: style: Variable 'alpha' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/lib/rasterlite_image.c:588:9: style: Variable 'alpha' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/lib/rasterlite_image.c:653:9: style: Variable 'alpha' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/lib/rasterlite_quantize.c:456:50: error: Division by zero. [zerodiv] librasterlite-1.1g/lib/rasterlite_quantize.c:421:27: note: Assignment 'total=0', assigned value is 0 librasterlite-1.1g/lib/rasterlite_quantize.c:437:22: note: Assuming condition is false librasterlite-1.1g/lib/rasterlite_quantize.c:456:50: note: Division by zero librasterlite-1.1g/lib/rasterlite_quantize.c:457:50: error: Division by zero. [zerodiv] librasterlite-1.1g/lib/rasterlite_quantize.c:421:27: note: Assignment 'total=0', assigned value is 0 librasterlite-1.1g/lib/rasterlite_quantize.c:437:22: note: Assuming condition is false librasterlite-1.1g/lib/rasterlite_quantize.c:457:50: note: Division by zero librasterlite-1.1g/lib/rasterlite_quantize.c:458:50: error: Division by zero. [zerodiv] librasterlite-1.1g/lib/rasterlite_quantize.c:421:27: note: Assignment 'total=0', assigned value is 0 librasterlite-1.1g/lib/rasterlite_quantize.c:437:22: note: Assuming condition is false librasterlite-1.1g/lib/rasterlite_quantize.c:458:50: note: Division by zero librasterlite-1.1g/lib/rasterlite_quantize.c:738:35: style: Parameter 'colorlist' can be declared as pointer to const [constParameter] librasterlite-1.1g/lib/rasterlite_quantize.c:589:30: style: Variable 'min_dist' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/lib/rasterlite_gif.c:253:66: style: Checking if unsigned expression 'count=GetDataBlock(fd,&scd->buf[2],ZeroDataBlockP)' is less than zero. [unsignedLessThanZero] librasterlite-1.1g/test/check_rastergen.c:98:2: error: Memory leak: refraster [memleak] librasterlite-1.1g/test/check_rastergen.c:98:2: error: Resource leak: reffilestream [resourceLeak] librasterlite-1.1g/test/check_metadata.c:124:15: style: Condition 'max_x!=180.0' is always false [knownConditionTrueFalse] librasterlite-1.1g/test/check_metadata.c:112:15: note: Assuming condition 'max_x!=180.0' is false librasterlite-1.1g/test/check_metadata.c:118:15: note: Assuming condition is false librasterlite-1.1g/test/check_metadata.c:124:15: note: Condition 'max_x!=180.0' is always false librasterlite-1.1g/lib/rasterlite_tiff.c:157:42: style: Parameter 'data' can be declared as pointer to const [constParameter] librasterlite-1.1g/lib/rasterlite_tiff.c:157:57: style: Parameter 'offset' can be declared as pointer to const [constParameter] librasterlite-1.1g/src/rasterlite_pyramid.c:740:6: style: Variable 'x' is reassigned a value before the old one has been used. [redundantAssignment] librasterlite-1.1g/src/rasterlite_pyramid.c:737:6: note: x is assigned librasterlite-1.1g/src/rasterlite_pyramid.c:740:6: note: x is overwritten librasterlite-1.1g/src/rasterlite_pyramid.c:589:12: style:inconclusive: Same expression used in consecutive assignments of 'source_max_x' and 'source_max_y'. [duplicateAssignExpression] librasterlite-1.1g/src/rasterlite_pyramid.c:590:12: note: Same expression used in consecutive assignments of 'source_max_x' and 'source_max_y'. librasterlite-1.1g/src/rasterlite_pyramid.c:589:12: note: Same expression used in consecutive assignments of 'source_max_x' and 'source_max_y'. librasterlite-1.1g/src/rasterlite_pyramid.c:1821:9: style: Variable 'cnt' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/src/rasterlite_topmost.c:539:12: style:inconclusive: Same expression used in consecutive assignments of 'extent_max_x' and 'extent_max_y'. [duplicateAssignExpression] librasterlite-1.1g/src/rasterlite_topmost.c:540:12: note: Same expression used in consecutive assignments of 'extent_max_x' and 'extent_max_y'. librasterlite-1.1g/src/rasterlite_topmost.c:539:12: note: Same expression used in consecutive assignments of 'extent_max_x' and 'extent_max_y'. librasterlite-1.1g/src/rasterlite_topmost.c:395:21: style: Local variable 'blob' shadows outer variable [shadowVariable] librasterlite-1.1g/src/rasterlite_topmost.c:361:11: note: Shadowed declaration librasterlite-1.1g/src/rasterlite_topmost.c:395:21: note: Shadow variable librasterlite-1.1g/src/rasterlite_topmost.c:397:13: style: Local variable 'blob_size' shadows outer variable [shadowVariable] librasterlite-1.1g/src/rasterlite_topmost.c:362:9: note: Shadowed declaration librasterlite-1.1g/src/rasterlite_topmost.c:397:13: note: Shadow variable librasterlite-1.1g/src/rasterlite_topmost.c:406:21: style: Local variable 'blob' shadows outer variable [shadowVariable] librasterlite-1.1g/src/rasterlite_topmost.c:361:11: note: Shadowed declaration librasterlite-1.1g/src/rasterlite_topmost.c:406:21: note: Shadow variable librasterlite-1.1g/src/rasterlite_topmost.c:408:13: style: Local variable 'blob_size' shadows outer variable [shadowVariable] librasterlite-1.1g/src/rasterlite_topmost.c:362:9: note: Shadowed declaration librasterlite-1.1g/src/rasterlite_topmost.c:408:13: note: Shadow variable librasterlite-1.1g/src/rasterlite_topmost.c:1665:9: style: Variable 'cnt' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/src/rasterlite_load.c:1280:12: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] librasterlite-1.1g/src/rasterlite_load.c:621:9: style: Condition 'prefix_rasters' is always false [knownConditionTrueFalse] librasterlite-1.1g/src/rasterlite_load.c:614:9: note: Assuming that condition 'prefix_rasters' is not redundant librasterlite-1.1g/src/rasterlite_load.c:621:9: note: Condition 'prefix_rasters' is always false librasterlite-1.1g/src/rasterlite_load.c:130:24: warning: Uninitialized variable: current_col [uninitvar] librasterlite-1.1g/src/rasterlite_load.c:114:19: note: Assuming condition is false librasterlite-1.1g/src/rasterlite_load.c:130:24: note: Uninitialized variable: current_col librasterlite-1.1g/src/rasterlite_load.c:1708:6: style: Variable 'cnt' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/src/rasterlite_load.c:1712:6: style: Variable 'cnt' is assigned a value that is never used. [unreadVariable] librasterlite-1.1g/src/rasterlite_grid.c:946:12: warning: Possible null pointer dereference: table [nullPointer] librasterlite-1.1g/src/rasterlite_grid.c:941:12: note: Assignment 'table=NULL', assigned value is 0 librasterlite-1.1g/src/rasterlite_grid.c:946:12: note: Null pointer dereference librasterlite-1.1g/src/rasterlite_grid.c:164:11: error: Uninitialized variables: &src.max, &src.red, &src.green, &src.blue [uninitvar] diff: head librasterlite-1.1g/lib/rasterlite_quantize.c:738:35: style: Parameter 'colorlist' can be declared as pointer to const [constParameter] 2.8 librasterlite-1.1g/lib/rasterlite_quantize.c:738:35: style: Parameter 'colorlist' can be declared with const [constParameter] head librasterlite-1.1g/lib/rasterlite_tiff.c:157:42: style: Parameter 'data' can be declared as pointer to const [constParameter] 2.8 librasterlite-1.1g/lib/rasterlite_tiff.c:157:42: style: Parameter 'data' can be declared with const [constParameter] head librasterlite-1.1g/lib/rasterlite_tiff.c:157:57: style: Parameter 'offset' can be declared as pointer to const [constParameter] 2.8 librasterlite-1.1g/lib/rasterlite_tiff.c:157:57: style: Parameter 'offset' can be declared with const [constParameter] 2.8 librasterlite-1.1g/src/rasterlite_load.c:130:24: error: Uninitialized variable: current_col [uninitvar] librasterlite-1.1g/src/rasterlite_load.c:114:19: note: Assuming condition is false librasterlite-1.1g/src/rasterlite_load.c:130:24: note: Uninitialized variable: current_col head librasterlite-1.1g/src/rasterlite_load.c:130:24: warning: Uninitialized variable: current_col [uninitvar] librasterlite-1.1g/src/rasterlite_load.c:114:19: note: Assuming condition is false librasterlite-1.1g/src/rasterlite_load.c:130:24: note: Uninitialized variable: current_col DONE