2025-07-09 12:14 ftp://ftp.de.debian.org/debian/pool/main/libg/libgdchart-gd2/libgdchart-gd2_0.11.5.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --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-63-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: 8f3d36a (2025-07-08 11:07:56 +0200) count: 58 57 elapsed-time: 81.5 88.6 head-timing-info: old-timing-info: head results: gdchart0.11.5dev/ft_samp.c:16:1: portability: Omitted return type of function 'main' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/ft_samp.c:68:1: portability: Omitted return type of function 'get_data' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/ft_samp.c:81:1: portability: Omitted return type of function 'get_individual_colors' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/ft_samp.c:29:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable GDC_title_font [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/ft_samp.c:77:50: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable RAND_MAX [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdc.c:25:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable gdFontTiny [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdc.c:283:8: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable gdFontMediumBold [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdc.c:152:11: style: Redundant initialization for 'strs_num'. The initialized value is overwritten before it is read. [redundantInitialization] gdchart0.11.5dev/gdc.c:148:19: note: strs_num is initialized gdchart0.11.5dev/gdc.c:152:11: note: strs_num is overwritten gdchart0.11.5dev/gdc.c:265:12: style:inconclusive: Function 'out_err' argument 6 names different: declaration 'str' definition 'err_str'. [funcArgNamesDifferent] gdchart0.11.5dev/gdc.h:156:14: note: Function 'out_err' argument 6 names different: declaration 'str' definition 'err_str'. gdchart0.11.5dev/gdc.c:265:12: note: Function 'out_err' argument 6 names different: declaration 'str' definition 'err_str'. gdchart0.11.5dev/gdc.c:37:15: style: Parameter 'nstr' can be declared as pointer to const [constParameterPointer] gdchart0.11.5dev/gdc.c:158:16: style: Variable 'sub_str[len]' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:197:66: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable h [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdc_pie.c:265:16: style: Variable 'lbl_wdth' is reassigned a value before the old one has been used. [redundantAssignment] gdchart0.11.5dev/gdc_pie.c:252:15: note: lbl_wdth is assigned gdchart0.11.5dev/gdc_pie.c:265:16: note: lbl_wdth is overwritten gdchart0.11.5dev/gdc_pie.c:266:16: style: Variable 'lbl_hgt' is reassigned a value before the old one has been used. [redundantAssignment] gdchart0.11.5dev/gdc_pie.c:253:15: note: lbl_hgt is assigned gdchart0.11.5dev/gdc_pie.c:266:16: note: lbl_hgt is overwritten gdchart0.11.5dev/gdc_pie.c:115:22: style:inconclusive: Function 'GDC_out_pie' argument 1 names different: declaration 'width' definition 'IMGWIDTH'. [funcArgNamesDifferent] gdchart0.11.5dev/gdcpie.h:77:27: note: Function 'GDC_out_pie' argument 1 names different: declaration 'width' definition 'IMGWIDTH'. gdchart0.11.5dev/gdc_pie.c:115:22: note: Function 'GDC_out_pie' argument 1 names different: declaration 'width' definition 'IMGWIDTH'. gdchart0.11.5dev/gdc_pie.c:116:13: style:inconclusive: Function 'GDC_out_pie' argument 2 names different: declaration 'height' definition 'IMGHEIGHT'. [funcArgNamesDifferent] gdchart0.11.5dev/gdcpie.h:78:15: note: Function 'GDC_out_pie' argument 2 names different: declaration 'height' definition 'IMGHEIGHT'. gdchart0.11.5dev/gdc_pie.c:116:13: note: Function 'GDC_out_pie' argument 2 names different: declaration 'height' definition 'IMGHEIGHT'. gdchart0.11.5dev/gdc_pie.c:120:13: style:inconclusive: Function 'GDC_out_pie' argument 6 names different: declaration 'labels' definition 'lbl'. [funcArgNamesDifferent] gdchart0.11.5dev/gdcpie.h:82:15: note: Function 'GDC_out_pie' argument 6 names different: declaration 'labels' definition 'lbl'. gdchart0.11.5dev/gdc_pie.c:120:13: note: Function 'GDC_out_pie' argument 6 names different: declaration 'labels' definition 'lbl'. gdchart0.11.5dev/gdc_pie.c:121:13: style:inconclusive: Function 'GDC_out_pie' argument 7 names different: declaration 'data' definition 'val'. [funcArgNamesDifferent] gdchart0.11.5dev/gdcpie.h:83:15: note: Function 'GDC_out_pie' argument 7 names different: declaration 'data' definition 'val'. gdchart0.11.5dev/gdc_pie.c:121:13: note: Function 'GDC_out_pie' argument 7 names different: declaration 'data' definition 'val'. gdchart0.11.5dev/gdc_pie.c:433:12: style: Local variable 'rad' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdc_pie.c:134:9: note: Shadowed declaration gdchart0.11.5dev/gdc_pie.c:433:12: note: Shadow variable gdchart0.11.5dev/gdc_pie.c:555:10: style: Local variable 'rad' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdc_pie.c:134:9: note: Shadowed declaration gdchart0.11.5dev/gdc_pie.c:555:10: note: Shadow variable gdchart0.11.5dev/gdc_pie.c:660:12: style: Local variable 'rad' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdc_pie.c:134:9: note: Shadowed declaration gdchart0.11.5dev/gdc_pie.c:660:12: note: Shadow variable gdchart0.11.5dev/gdc_pie.c:121:13: style: Parameter 'val' can be declared as const array [constParameter] gdchart0.11.5dev/gdc_pie.c:479:10: warning: Uninitialized variables: tmp_slice.i, tmp_slice.hidden, tmp_slice.angle, tmp_slice.slice [uninitvar] gdchart0.11.5dev/gdc_pie.c:445:14: note: Assuming condition is false gdchart0.11.5dev/gdc_pie.c:479:10: note: Uninitialized variables: tmp_slice.i, tmp_slice.hidden, tmp_slice.angle, tmp_slice.slice gdchart0.11.5dev/gdc_pie.c:202:28: style: Variable 'label_explode_limit' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:146:9: style: Variable 'num_slices1' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:147:5: style: Variable 'num_slices2' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:148:8: style: Variable 'any_too_small' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:156:8: style: Variable 'do3Dx' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:157:5: style: Variable 'do3Dy' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie.c:202:8: style: Variable 'label_explode_limit' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdc_pie_samp.c:13:1: portability: Omitted return type of function 'main' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/gdc_pie_samp.c:75:10: warning: If resource allocation fails, then there is a possible null pointer dereference: fp [nullPointerOutOfResources] gdchart0.11.5dev/gdc_pie_samp.c:32:19: note: Assuming allocation function fails gdchart0.11.5dev/gdc_pie_samp.c:32:19: note: Assignment 'fp=fopen("pie.png","wb")', assigned value is 0 gdchart0.11.5dev/gdc_pie_samp.c:75:10: note: Null pointer dereference gdchart0.11.5dev/gdc_samp1.c:17:1: portability: Omitted return type of function 'main' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/gdc_samp2.c:22:1: portability: Omitted return type of function 'main' defaults to int, this is not supported by ISO C99 and later standards. [returnImplicitInt] gdchart0.11.5dev/gdc_samp2.c:25:40: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FLT_MAX [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdc_samp2.c:86:10: warning: If resource allocation fails, then there is a possible null pointer dereference: outpng1 [nullPointerOutOfResources] gdchart0.11.5dev/gdc_samp2.c:45:26: note: Assuming allocation function fails gdchart0.11.5dev/gdc_samp2.c:45:26: note: Assignment 'outpng1=fopen("g2.png","wb")', assigned value is 0 gdchart0.11.5dev/gdc_samp2.c:86:10: note: Null pointer dereference gdchart0.11.5dev/gdchart.c:93:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable x [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdchart.c:141:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable x [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdchart.c:217:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable x [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdchart.c:248:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FLT_MAX [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdchart.c:388:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FLT_MAX [valueFlowBailoutIncompleteVar] gdchart0.11.5dev/gdchart.c:710:24: style: Redundant condition: GDC_xlabel_ctl. '!GDC_xlabel_ctl || (GDC_xlabel_ctl && GDC_xlabel_ctl[i])' is equivalent to '!GDC_xlabel_ctl || GDC_xlabel_ctl[i]' [redundantCondition] gdchart0.11.5dev/gdchart.c:437:2: style: Same expression in both branches of ternary operator. [duplicateExpressionTernary] gdchart0.11.5dev/gdchart.c:301:19: style:inconclusive: Function 'out_graph' argument 1 names different: declaration 'imgwidth' definition 'IMGWIDTH'. [funcArgNamesDifferent] gdchart0.11.5dev/gdchart.h:210:23: note: Function 'out_graph' argument 1 names different: declaration 'imgwidth' definition 'IMGWIDTH'. gdchart0.11.5dev/gdchart.c:301:19: note: Function 'out_graph' argument 1 names different: declaration 'imgwidth' definition 'IMGWIDTH'. gdchart0.11.5dev/gdchart.c:302:13: style:inconclusive: Function 'out_graph' argument 2 names different: declaration 'imgheight' definition 'IMGHEIGHT'. [funcArgNamesDifferent] gdchart0.11.5dev/gdchart.h:211:14: note: Function 'out_graph' argument 2 names different: declaration 'imgheight' definition 'IMGHEIGHT'. gdchart0.11.5dev/gdchart.c:302:13: note: Function 'out_graph' argument 2 names different: declaration 'imgheight' definition 'IMGHEIGHT'. gdchart0.11.5dev/gdchart.c:1376:11: style: Local variable 'k' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdchart.c:377:14: note: Shadowed declaration gdchart0.11.5dev/gdchart.c:1376:11: note: Shadow variable gdchart0.11.5dev/gdchart.c:1391:11: style: Local variable 'k' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdchart.c:377:14: note: Shadowed declaration gdchart0.11.5dev/gdchart.c:1391:11: note: Shadow variable gdchart0.11.5dev/gdchart.c:1495:11: style: Local variable 'j' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdchart.c:377:11: note: Shadowed declaration gdchart0.11.5dev/gdchart.c:1495:11: note: Shadow variable gdchart0.11.5dev/gdchart.c:1513:12: style: Local variable 'k' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdchart.c:377:14: note: Shadowed declaration gdchart0.11.5dev/gdchart.c:1513:12: note: Shadow variable gdchart0.11.5dev/gdchart.c:1711:10: style: Local variable 'j' shadows outer variable [shadowVariable] gdchart0.11.5dev/gdchart.c:377:11: note: Shadowed declaration gdchart0.11.5dev/gdchart.c:1711:10: note: Shadow variable gdchart0.11.5dev/gdchart.c:65:2: style: Unused variable: lnclr [unusedVariable] gdchart0.11.5dev/gdchart.c:66:2: style: Unused variable: shclr [unusedVariable] gdchart0.11.5dev/gdchart.c:1495:13: style: Variable 'j' is assigned a value that is never used. [unreadVariable] gdchart0.11.5dev/gdchart.c:377:14: style: Unused variable: k [unusedVariable] gdchart0.11.5dev/gdchart.c:463:5: style: Unused variable: ThumbDColor [unusedVariable] gdchart0.11.5dev/gdchart.c:464:5: style: Unused variable: ThumbLblColor [unusedVariable] gdchart0.11.5dev/gdchart.c:465:5: style: Unused variable: ThumbUColor [unusedVariable] gdchart0.11.5dev/price_conv.c:29:12: style: Parameter 'fltfmt' can be declared as pointer to const [constParameterPointer] diff: head gdchart0.11.5dev/gdc_pie.c:202:8: style: Variable 'label_explode_limit' is assigned a value that is never used. [unreadVariable] DONE