2025-09-03 04:33 ftp://ftp.de.debian.org/debian/pool/main/r/r-cran-cairo/r-cran-cairo_1.6-2.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=motif --library=icu --library=cairo --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 -j4 platform: Linux-6.12.41+deb13-amd64-x86_64-with-glibc2.41 python: 3.13.5 client-version: 1.3.67 compiler: g++ (Debian 14.2.0-19) 14.2.0 cppcheck: head 2.18.0 head-info: e6e045f (2025-09-02 21:05:14 +0200) count: 6 40 elapsed-time: 0.0 0.1 head-timing-info: old-timing-info: head results: Cairo/src/backend.h:14:0: error: failed to evaluate #if condition, undefined function-like macro invocation: R_Version( ... ) [preprocessorErrorDirective] Cairo/src/backend.h:14:2: error: failed to evaluate #if condition, undefined function-like macro invocation: R_Version( ... ) [preprocessorErrorDirective] Cairo/src/img-jpeg.c:69:27: style: Parameter 'buf' can be declared as pointer to const [constParameterPointer] Cairo/src/img-jpeg.c:69:52: style: Parameter 'fn' can be declared as pointer to const [constParameterPointer] Cairo/src/img-tiff.c:64:26: style: Parameter 'buf' can be declared as pointer to const [constParameterPointer] Cairo/src/img-tiff.c:64:51: style: Parameter 'fn' can be declared as pointer to const [constParameterPointer] diff: head Cairo/src/backend.h:14:0: error: failed to evaluate #if condition, undefined function-like macro invocation: R_Version( ... ) [preprocessorErrorDirective] head Cairo/src/backend.h:14:2: error: failed to evaluate #if condition, undefined function-like macro invocation: R_Version( ... ) [preprocessorErrorDirective] 2.18.0 Cairo/src/cairobem.c:23:5: warning: If memory allocation fails, then there is a possible null pointer dereference: l [nullPointerOutOfMemory] Cairo/src/cairobem.c:21:43: note: Assuming allocation function fails Cairo/src/cairobem.c:21:15: note: Assignment 'l->next=(struct bed_list_st*)malloc(sizeof(struct bed_list_st))', assigned value is 0 Cairo/src/cairobem.c:22:10: note: Assignment 'l=l->next', assigned value is 0 Cairo/src/cairobem.c:23:5: note: Null pointer dereference 2.18.0 Cairo/src/cairobem.c:25:3: warning: If memory allocation fails, then there is a possible null pointer dereference: l [nullPointerOutOfMemory] Cairo/src/cairobem.c:21:43: note: Assuming allocation function fails Cairo/src/cairobem.c:21:15: note: Assignment 'l->next=(struct bed_list_st*)malloc(sizeof(struct bed_list_st))', assigned value is 0 Cairo/src/cairobem.c:22:10: note: Assignment 'l=l->next', assigned value is 0 Cairo/src/cairobem.c:25:3: note: Null pointer dereference 2.18.0 Cairo/src/cairobem.c:62:27: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable STRSXP [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:256:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_GE_version [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:290:38: style: Parameter 'par' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/cairogd.c:417:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:453:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:459:13: style: Variable 'gd' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/cairogd.c:474:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable VECSXP [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:507:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EXTPTRSXP [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:510:18: style: Variable 'data' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/cairogd.c:525:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EXTPTRSXP [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:52:57: style: Parameter 'dpi' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/cairogd.c:531:10: style: Variable 'rc' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/cairogd.c:535:2: style: Consecutive return, break, continue, goto or throw statements are unnecessary. [duplicateBreak] 2.18.0 Cairo/src/cairogd.c:540:13: style: Variable 'gd' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/cairogd.c:554:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:559:13: style: Variable 'gd' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/cairogd.c:570:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairogd.c:64:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FALSE [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/cairotalk.c:39:0: error: #error This device needs at least R version 1.9.0 [preprocessorErrorDirective] 2.18.0 Cairo/src/cairotalk.c:39:2: error: #error This device needs at least R version 1.9.0 [preprocessorErrorDirective] 2.18.0 Cairo/src/img-backend.c:102:63: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CAIRO_FORMAT_RGB24 [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/img-backend.c:119:50: style: Parameter 'be' can be declared as pointer to const. However it seems that 'image_save_page_null' is a callback function, if 'be' is declared with const you might also need to cast function pointer(s). [constParameterCallback] Cairo/src/img-backend.c:185:19: note: You might need to cast the function pointer here Cairo/src/img-backend.c:119:50: note: Parameter 'be' can be declared as pointer to const 2.18.0 Cairo/src/img-backend.c:142:52: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/img-backend.c:202:54: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CAIRO_FORMAT_RGB24 [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/img-backend.c:250:19: error: Memory pointed to by 'buf' is freed twice. [doubleFree] Cairo/src/img-backend.c:231:3: note: Memory pointed to by 'buf' is freed twice. Cairo/src/img-backend.c:250:19: note: Memory pointed to by 'buf' is freed twice. 2.18.0 Cairo/src/img-backend.c:59:53: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable R_NilValue [valueFlowBailoutIncompleteVar] 2.18.0 Cairo/src/img-backend.c:72:24: style: Variable 'image' can be declared as pointer to const [constVariablePointer] 2.18.0 Cairo/src/img-backend.c:77:2: warning: If memory allocation fails, then there is a possible null pointer dereference: fn [nullPointerOutOfMemory] Cairo/src/img-backend.c:76:19: note: Assuming allocation function fails Cairo/src/img-backend.c:76:5: note: Assignment 'fn=(char*)malloc(l)', assigned value is 0 Cairo/src/img-backend.c:77:2: note: Null pointer dereference 2.18.0 Cairo/src/img-backend.c:78:11: warning: If memory allocation fails, then there is a possible null pointer dereference: fn [nullPointerOutOfMemory] Cairo/src/img-backend.c:76:19: note: Assuming allocation function fails Cairo/src/img-backend.c:76:5: note: Assignment 'fn=(char*)malloc(l)', assigned value is 0 Cairo/src/img-backend.c:78:11: note: Null pointer dereference 2.18.0 Cairo/src/pdf-backend.c:142:56: style: Parameter 'be' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/ps-backend.c:102:55: style: Parameter 'be' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/svg-backend.c:102:56: style: Parameter 'be' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/w32-backend.c:481:56: style: Parameter 'be' can be declared as pointer to const [constParameterPointer] 2.18.0 Cairo/src/xlib-backend.c:442:57: style: Parameter 'be' can be declared as pointer to const [constParameterPointer] DONE