2025-11-23 08:49 ftp://ftp.de.debian.org/debian/pool/main/p/pluto-sat-code/pluto-sat-code_0.0~git20180301.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 -j4 platform: Linux-5.4.0-216-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.69 compiler: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 cppcheck: head 2.18.0 head-info: cb76e52 (2025-11-22 14:47:37 +0100) count: 109 108 elapsed-time: 4.4 5.3 head-timing-info: old-timing-info: head results: pluto-sat-code/dynamic.cpp:55:27: style: C-style pointer casting [cstyleCast] pluto-sat-code/dynamic.cpp:79:27: style: C-style pointer casting [cstyleCast] pluto-sat-code/dynamic.cpp:102:16: style: C-style pointer casting [cstyleCast] pluto-sat-code/common.cpp:114:69: style:inconclusive: Function 'sxpx_posn_vel' argument 3 names different: declaration 'e' definition 'ecc'. [funcArgNamesDifferent] pluto-sat-code/norad_in.h:42:69: note: Function 'sxpx_posn_vel' argument 3 names different: declaration 'e' definition 'ecc'. pluto-sat-code/common.cpp:114:69: note: Function 'sxpx_posn_vel' argument 3 names different: declaration 'e' definition 'ecc'. pluto-sat-code/elem2tle.cpp:208:53: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable RAND_MAX [valueFlowBailoutIncompleteVar] pluto-sat-code/get_high.cpp:22:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] pluto-sat-code/elem2tle.cpp:457:36: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AU_IN_KM [valueFlowBailoutIncompleteVar] pluto-sat-code/mergetle.cpp:132:25: style: C-style pointer casting [cstyleCast] pluto-sat-code/mergetle.cpp:132:41: style: C-style pointer casting [cstyleCast] pluto-sat-code/mergetle.cpp:159:16: style: C-style pointer casting [cstyleCast] pluto-sat-code/mergetle.cpp:160:26: style: C-style pointer casting [cstyleCast] pluto-sat-code/obs_tes2.cpp:52:11: style: The scope of the variable 'header_line_shown' can be reduced. [variableScope] pluto-sat-code/out_comp.cpp:40:29: style: The scope of the variable 'delta' can be reduced. [variableScope] pluto-sat-code/obs_test.cpp:41:11: style: The scope of the variable 'lat' can be reduced. [variableScope] pluto-sat-code/obs_test.cpp:41:21: style: The scope of the variable 'lon' can be reduced. [variableScope] pluto-sat-code/obs_test.cpp:41:31: style: The scope of the variable 'ht_in_meters' can be reduced. [variableScope] pluto-sat-code/obs_test.cpp:41:50: style: The scope of the variable 'jd' can be reduced. [variableScope] pluto-sat-code/obs_test.cpp:42:8: style: The scope of the variable 'ephem' can be reduced. [variableScope] pluto-sat-code/sat_id2.cpp:42:45: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] pluto-sat-code/sat_id2.cpp:35:7: error: Memory leak: buff [memleak] pluto-sat-code/sat_id2.cpp:57:62: warning: If resource allocation fails, then there is a possible null pointer dereference: ofile [nullPointerOutOfResources] pluto-sat-code/sat_id2.cpp:54:32: note: Assuming allocation function fails pluto-sat-code/sat_id2.cpp:54:32: note: Assignment 'ofile=fopen(temp_obs_filename,bytes_written?"ab":"wb")', assigned value is 0 pluto-sat-code/sat_id2.cpp:57:62: note: Null pointer dereference pluto-sat-code/sat_id2.cpp:58:21: warning: If resource allocation fails, then there is a possible null pointer dereference: ofile [nullPointerOutOfResources] pluto-sat-code/sat_id2.cpp:54:32: note: Assuming allocation function fails pluto-sat-code/sat_id2.cpp:54:32: note: Assignment 'ofile=fopen(temp_obs_filename,bytes_written?"ab":"wb")', assigned value is 0 pluto-sat-code/sat_id2.cpp:58:21: note: Null pointer dereference pluto-sat-code/sat_id2.cpp:14:17: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:817:65: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCKS_PER_SEC [valueFlowBailoutIncompleteVar] pluto-sat-code/deep.cpp:711:20: style: Local variable 'sinis' shadows outer variable [shadowVariable] pluto-sat-code/deep.cpp:628:11: note: Shadowed declaration pluto-sat-code/deep.cpp:711:20: note: Shadow variable pluto-sat-code/deep.cpp:712:20: style: Local variable 'cosis' shadows outer variable [shadowVariable] pluto-sat-code/deep.cpp:628:18: note: Shadowed declaration pluto-sat-code/deep.cpp:712:20: note: Shadow variable pluto-sat-code/sdp4.cpp:137:42: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:138:4: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:139:4: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:142:22: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:277:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:277:36: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:278:26: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:280:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:281:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:281:18: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:284:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:284:30: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:285:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:287:20: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:290:7: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:292:15: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:293:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:296:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:296:20: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:298:20: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:312:8: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:312:24: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:312:43: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:314:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:314:26: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:315:3: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:315:26: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:317:26: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:317:46: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:317:60: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:318:17: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:318:34: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:318:50: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp4.cpp:177:15: style: Variable 'opos' can be declared as pointer to const [constVariablePointer] pluto-sat-code/sgp.cpp:67:10: style: Condition 'e>1.-chicken_factor_on_eccentricity' is always false [knownConditionTrueFalse] pluto-sat-code/sgp.cpp:66:8: note: Assignment 'e=1.0E-6', assigned value is 1e-06 pluto-sat-code/sgp.cpp:67:10: note: Condition 'e>1.-chicken_factor_on_eccentricity' is always false pluto-sat-code/sgp.cpp:57:20: style: The scope of the variable 'tem2' can be reduced. [variableScope] pluto-sat-code/sdp8.cpp:28:28: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sdp8.cpp:86:27: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp4.cpp:55:4: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp4.cpp:56:9: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp4.cpp:61:7: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp4.cpp:106:8: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp4.cpp:55:4: portability: Casting from double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp4.cpp:56:9: portability: Casting from double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp4.cpp:61:7: portability: Casting from double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp4.cpp:106:8: portability: Casting from const double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp4.cpp:92:9: style: The scope of the variable 'temp' can be reduced. [variableScope] pluto-sat-code/test2.cpp:24:21: style: The scope of the variable 'dundee_output' can be reduced. [variableScope] pluto-sat-code/test2.cpp:26:8: style: The scope of the variable 'ephem' can be reduced. [variableScope] pluto-sat-code/test3.cpp:125:58: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable CLOCKS_PER_SEC [valueFlowBailoutIncompleteVar] pluto-sat-code/sgp8.cpp:135:7: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp8.cpp:205:7: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp8.cpp:230:8: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast] pluto-sat-code/sgp8.cpp:135:7: portability: Casting from double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp8.cpp:205:7: portability: Casting from double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp8.cpp:230:8: portability: Casting from const double * to signed int * is not portable due to different binary data representations on different platforms. [invalidPointerCast] pluto-sat-code/sgp8.cpp:195:7: style: Variable 'r1' is assigned an expression that holds the same value. [redundantAssignment] pluto-sat-code/sgp8.cpp:192:14: note: tmnddt is assigned 'xnddt*1e9' here. pluto-sat-code/sgp8.cpp:195:7: note: Variable 'r1' is assigned an expression that holds the same value. pluto-sat-code/sgp8.cpp:70:31: style: The scope of the variable 'eddot' can be reduced. [variableScope] pluto-sat-code/sgp8.cpp:70:39: style: The scope of the variable 'etdt' can be reduced. [variableScope] pluto-sat-code/test3.cpp:94:23: style: The scope of the variable 'delta' can be reduced. [variableScope] pluto-sat-code/elem2tle.cpp:25:4: portability: Using memset() on struct which contains a floating point number. [memsetClassFloat] pluto-sat-code/elem2tle.cpp:158:30: warning: Identical condition 'vect_to_tle_rval==-1', second condition is always false [identicalConditionAfterEarlyExit] pluto-sat-code/elem2tle.cpp:152:25: note: If condition 'vect_to_tle_rval==-1' is true, the function will return/exit pluto-sat-code/elem2tle.cpp:158:30: note: Testing identical condition 'vect_to_tle_rval==-1' pluto-sat-code/test3.cpp:34:8: style: Variable 'ephem' is assigned a value that is never used. [unreadVariable] pluto-sat-code/test_out.cpp:56:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] pluto-sat-code/tle_date.c:98:61: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable seconds_per_day [valueFlowBailoutIncompleteVar] pluto-sat-code/test_sat.cpp:84:11: style: Variable 'test_ptr' can be declared as pointer to const [constVariablePointer] pluto-sat-code/tle_date.c:27:4: error: Resource leak: ifile [resourceLeak] pluto-sat-code/tle_date.c:27:10: style: Redundant initialization for 'ifile'. The initialized value is overwritten before it is read. [redundantInitialization] pluto-sat-code/tle_date.c:20:16: note: ifile is initialized pluto-sat-code/tle_date.c:27:10: note: ifile is overwritten pluto-sat-code/tle_date.c:104:8: style: Variable 'mjd' is reassigned a value before the old one has been used. [redundantAssignment] pluto-sat-code/tle_date.c:103:8: note: mjd is assigned pluto-sat-code/tle_date.c:104:8: note: mjd is overwritten pluto-sat-code/tle_date.c:70:16: style: Variable 'filename' can be declared as pointer to const [constVariablePointer] pluto-sat-code/test_out.cpp:26:9: style: The scope of the variable 'legend_shown' can be reduced. [variableScope] pluto-sat-code/sat_id.cpp:325:26: warning: Obsolete function 'alloca' called. [allocaCalled] pluto-sat-code/sat_id.cpp:267:4: portability: Using memset() on struct which contains a floating point number. [memsetClassFloat] pluto-sat-code/sat_id.cpp:214:18: warning: If memory allocation fails, then there is a possible null pointer dereference: cached_data [nullPointerOutOfMemory] pluto-sat-code/sat_id.cpp:213:35: note: Assuming allocation function fails pluto-sat-code/sat_id.cpp:213:21: note: Assignment 'cached_data=(char*)malloc(size+1)', assigned value is 0 pluto-sat-code/sat_id.cpp:214:18: note: Null pointer dereference pluto-sat-code/sat_id.cpp:213:21: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:293:17: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:306:30: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:307:30: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:324:17: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:325:18: style: C-style pointer casting [cstyleCast] pluto-sat-code/sat_id.cpp:176:31: style: Variable 'cached_ptr' can be declared as pointer to const [constVariablePointer] pluto-sat-code/sat_id.cpp:304:61: style: Parameter 'context' can be declared as pointer to const. However it seems that 'compare_obs' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] pluto-sat-code/sat_id.cpp:807:46: note: You might need to cast the function pointer here pluto-sat-code/sat_id.cpp:304:61: note: Parameter 'context' can be declared as pointer to const pluto-sat-code/sat_id.cpp:468:42: style: Parameter 'tle' can be declared as pointer to const [constParameterPointer] diff: head pluto-sat-code/sat_id.cpp:304:61: style: Parameter 'context' can be declared as pointer to const. However it seems that 'compare_obs' is a callback function, if 'context' is declared with const you might also need to cast function pointer(s). [constParameterCallback] pluto-sat-code/sat_id.cpp:807:46: note: You might need to cast the function pointer here pluto-sat-code/sat_id.cpp:304:61: note: Parameter 'context' can be declared as pointer to const DONE