2025-05-05 14:52 ftp://ftp.de.debian.org/debian/pool/main/l/looktxt/looktxt_1.4.1.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 -j3 platform: Linux-6.8.0-1022-oracle-aarch64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 cppcheck: head 2.17.0 head-info: fcc0493 (2025-05-05 13:08:11 +0200) count: 106 104 elapsed-time: 11.7 12.0 head-timing-info: old-timing-info: head results: looktxt-v1.4.1/looktxt.c:350:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] looktxt-v1.4.1/looktxt.c:947:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] looktxt-v1.4.1/looktxt.c:2422:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EOF [valueFlowBailoutIncompleteVar] looktxt-v1.4.1/looktxt.c:3584:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] looktxt-v1.4.1/looktxt.c:1872:21: style:inconclusive: Boolean expression '!list.length' is used in bitwise operation. Did you mean '||'? [bitwiseOnBoolean] looktxt-v1.4.1/looktxt.c:2520:29: style:inconclusive: Boolean expression 'columns||!last_columns' is used in bitwise operation. Did you mean '&&'? [bitwiseOnBoolean] looktxt-v1.4.1/looktxt.c:1493:7: warning:inconclusive: The buffer 'ntmp' may not be null-terminated after the call to strncpy(). [terminateStrncpy] looktxt-v1.4.1/looktxt.c:1872:21: style: Boolean result is used in bitwise operation. Clarify expression with parentheses. [clarifyCondition] looktxt-v1.4.1/looktxt.c:3749:33: style: Redundant condition: options.metadata_only. '!A || (A && B)' is equivalent to '!A || B' [redundantCondition] looktxt-v1.4.1/looktxt.c:3931:23: style: The if condition is the same as the previous if condition [duplicateCondition] looktxt-v1.4.1/looktxt.c:3926:23: note: First condition looktxt-v1.4.1/looktxt.c:3931:23: note: Second condition looktxt-v1.4.1/looktxt.c:889:7: style: Condition 'header' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:889:23: style: Condition 'strlen(header)' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:887:18: note: Assuming that condition '!strlen(header)' is not redundant looktxt-v1.4.1/looktxt.c:889:23: note: Condition 'strlen(header)' is always true looktxt-v1.4.1/looktxt.c:2498:13: style: Condition 'possiblenum' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2503:15: style: Condition 'possiblenum' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2799:9: style: Condition 'name' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2968:9: style: Condition 'section' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2968:26: style: Condition 'strlen(section)' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2957:39: note: Assuming that condition '!strlen(section)' is not redundant looktxt-v1.4.1/looktxt.c:2968:26: note: Condition 'strlen(section)' is always true looktxt-v1.4.1/looktxt.c:2977:7: style: Condition 'section' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:3838:54: style: Condition 'file.TxtHandle' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:4240:26: style: Condition 'argv[i][0]!='-'' is always true [knownConditionTrueFalse] looktxt-v1.4.1/looktxt.c:2164:3: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2164:3: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2165:3: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2165:3: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2166:3: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2166:3: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2167:3: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2167:3: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2167:44: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2167:44: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2168:15: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2168:15: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:2168:30: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2168:30: note: Null pointer dereference looktxt-v1.4.1/looktxt.c:3281:10: portability: Casting between char * and double * which have an incompatible binary data representation. [invalidPointerCast] looktxt-v1.4.1/looktxt.c:998:16: style: Variable 'p_start' is reassigned a value before the old one has been used. [redundantAssignment] looktxt-v1.4.1/looktxt.c:997:11: note: p_start is assigned looktxt-v1.4.1/looktxt.c:998:16: note: p_start is overwritten looktxt-v1.4.1/looktxt.c:2407:20: style: Variable 'startcharpos' is reassigned a value before the old one has been used. [redundantAssignment] looktxt-v1.4.1/looktxt.c:2396:20: note: startcharpos is assigned looktxt-v1.4.1/looktxt.c:2407:20: note: startcharpos is overwritten looktxt-v1.4.1/looktxt.c:2564:30: style: Variable 'columns' is reassigned a value before the old one has been used. [redundantAssignment] looktxt-v1.4.1/looktxt.c:2558:27: note: columns is assigned looktxt-v1.4.1/looktxt.c:2564:30: note: columns is overwritten looktxt-v1.4.1/looktxt.c:955:25: style: Unsigned expression '*offset' can't be negative so it is unnecessary to test it. [unsignedPositive] looktxt-v1.4.1/looktxt.c:2013:18: style: Checking if unsigned expression 'start' is less than zero. [unsignedLessThanZero] looktxt-v1.4.1/looktxt.c:832:40: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:874:36: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1228:48: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1276:86: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1278:108: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1508:53: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1766:69: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:1780:70: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:2792:53: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:2795:40: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:2800:69: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:2844:50: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:2970:53: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3022:51: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3025:38: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3031:105: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3317:54: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3454:49: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3713:69: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3716:55: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3719:55: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3722:43: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3729:60: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3733:84: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3769:40: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:3816:36: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:4393:9: portability: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour. [varFuncNullUB] looktxt-v1.4.1/looktxt.c:356:16: style: Parameter 'pointer' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:687:21: style: Parameter 'string' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:700:23: style: Parameter 'string' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:721:9: style: Variable 'arg' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:752:35: style: Parameter 'from' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:752:47: style: Parameter 'to' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:774:9: style: Variable 'badchars' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:775:9: style: Variable 'quotechars' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:785:11: style: Variable 'p' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:929:43: style: Parameter 'field' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:934:9: style: Variable 'end_pos' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:962:25: style: Parameter 'category' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:1046:11: style: Variable 'tmp' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:1056:15: style: Variable 'printf_formats' can be declared as const array [constVariable] looktxt-v1.4.1/looktxt.c:1199:11: style: Variable 'dot_pos' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:1202:11: style: Variable 'name_pos' can be declared as pointer to const [constVariablePointer] looktxt-v1.4.1/looktxt.c:1356:29: style: Parameter 'format_const' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:1381:32: style: Parameter 'format_const' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:1949:54: style: Parameter 'element' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:2244:26: style: Parameter 'pgmname' can be declared as pointer to const [constParameterPointer] looktxt-v1.4.1/looktxt.c:870:7: style: Variable 'tmp1' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:875:10: style: Variable 'valid' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1006:36: style: Variable 'tmp0' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1203:24: style: Variable 'dot_length' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1220:18: style: Variable 'path_pos' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1221:18: style: Variable 'path_length' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1306:15: style: Variable 'FullName' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1337:15: style: Variable 'FullName' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1850:10: style: Variable 'parts' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:1857:9: style: Variable 'root' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:2102:17: style: Variable 'string' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:2345:22: style: Variable 'last_is' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:2348:22: style: Variable 'found' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3044:52: style: Variable 'struct_section' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3190:18: style: Variable 'length' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3730:23: style: Variable 'name_shorter' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3740:13: style: Variable 'name' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3740:41: style: Variable 'to_register' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3750:23: style: Variable 'index_field' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3897:18: style: Variable 'last_valid_name' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:3920:25: style: Variable 'section_current_valid' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:4055:38: style: Variable 'found_sections.section_names' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:4056:38: style: Variable 'found_sections.section_fields' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:4065:9: style: Variable 'file' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:4066:13: style: Variable 'filename' is assigned a value that is never used. [unreadVariable] looktxt-v1.4.1/looktxt.c:4113:20: style: Variable 'struct_char' is assigned a value that is never used. [unreadVariable] diff: head looktxt-v1.4.1/looktxt.c:2167:44: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2167:44: note: Null pointer dereference head looktxt-v1.4.1/looktxt.c:2168:30: warning: If memory allocation fails, then there is a possible null pointer dereference: table [nullPointerOutOfMemory] looktxt-v1.4.1/looktxt.c:2161:36: note: Assuming allocation function fails looktxt-v1.4.1/looktxt.c:2161:36: note: Assignment 'table=malloc(sizeof(struct table_struct))', assigned value is 0 looktxt-v1.4.1/looktxt.c:2168:30: note: Null pointer dereference DONE