2025-05-10 00:18 ftp://ftp.de.debian.org/debian/pool/main/c/cthreadpool/cthreadpool_0.0+git20231218.4eb5a69.orig.tar.xz 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-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: b3c7f00 (2025-05-09 17:59:20 +0200) count: 20 20 elapsed-time: 0.2 0.1 head-timing-info: old-timing-info: head results: cthreadpool-0.0+git20231218.4eb5a69/example.c:20:2: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] cthreadpool-0.0+git20231218.4eb5a69/example.c:19:17: style: Parameter 'arg' can be declared as pointer to const. However it seems that 'task' is a callback function, if 'arg' is declared with const you might also need to cast function pointer(s). [constParameterCallback] cthreadpool-0.0+git20231218.4eb5a69/example.c:32:27: note: You might need to cast the function pointer here cthreadpool-0.0+git20231218.4eb5a69/example.c:19:17: note: Parameter 'arg' can be declared as pointer to const cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:24:18: warning: If memory allocation fails, then there is a possible null pointer dereference: threads [nullPointerOutOfMemory] cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assuming allocation function fails cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assignment 'threads=malloc(2*sizeof(pthread_t))', assigned value is 0 cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:24:18: note: Null pointer dereference cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:26:17: warning: If memory allocation fails, then there is a possible null pointer dereference: threads [nullPointerOutOfMemory] cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assuming allocation function fails cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assignment 'threads=malloc(2*sizeof(pthread_t))', assigned value is 0 cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:26:17: note: Null pointer dereference cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:27:17: warning: If memory allocation fails, then there is a possible null pointer dereference: threads [nullPointerOutOfMemory] cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assuming allocation function fails cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assignment 'threads=malloc(2*sizeof(pthread_t))', assigned value is 0 cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:27:17: note: Null pointer dereference cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:33:15: warning: If memory allocation fails, then there is a possible null pointer dereference: threads [nullPointerOutOfMemory] cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assuming allocation function fails cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assignment 'threads=malloc(2*sizeof(pthread_t))', assigned value is 0 cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:33:15: note: Null pointer dereference cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:34:15: warning: If memory allocation fails, then there is a possible null pointer dereference: threads [nullPointerOutOfMemory] cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assuming allocation function fails cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:23:18: note: Assignment 'threads=malloc(2*sizeof(pthread_t))', assigned value is 0 cthreadpool-0.0+git20231218.4eb5a69/tests/ext_bugs/memleak.c:34:15: note: Null pointer dereference cthreadpool-0.0+git20231218.4eb5a69/tests/src/conc_increment.c:19:26: style: Parameter 'argv' can be declared as const array [constParameter] cthreadpool-0.0+git20231218.4eb5a69/tests/src/no_work.c:8:26: style: Parameter 'argv' can be declared as const array [constParameter] cthreadpool-0.0+git20231218.4eb5a69/tests/src/nonzero_heap_stack.c:12:2: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint] cthreadpool-0.0+git20231218.4eb5a69/tests/src/pause_resume.c:23:26: style: Parameter 'argv' can be declared as const array [constParameter] cthreadpool-0.0+git20231218.4eb5a69/tests/src/wait.c:19:19: style: Parameter 'secs' can be declared as pointer to const. However it seems that 'sleep_1' is a callback function, if 'secs' is declared with const you might also need to cast function pointer(s). [constParameterCallback] cthreadpool-0.0+git20231218.4eb5a69/tests/src/wait.c:42:34: note: You might need to cast the function pointer here cthreadpool-0.0+git20231218.4eb5a69/tests/src/wait.c:19:19: note: Parameter 'secs' can be declared as pointer to const cthreadpool-0.0+git20231218.4eb5a69/thpool.c:153:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:200:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:305:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:351:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:528:3: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:456:61: style:inconclusive: Function 'jobqueue_push' argument 2 names different: declaration 'newjob_p' definition 'newjob'. [funcArgNamesDifferent] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:122:62: note: Function 'jobqueue_push' argument 2 names different: declaration 'newjob_p' definition 'newjob'. cthreadpool-0.0+git20231218.4eb5a69/thpool.c:456:61: note: Function 'jobqueue_push' argument 2 names different: declaration 'newjob_p' definition 'newjob'. cthreadpool-0.0+git20231218.4eb5a69/thpool.c:265:28: style: Parameter 'thpool_p' can be declared as pointer to const [constParameterPointer] cthreadpool-0.0+git20231218.4eb5a69/thpool.c:284:41: style: Parameter 'thpool_p' can be declared as pointer to const [constParameterPointer] diff: DONE