{ "tokens": { "input": 16650, "cache_read": 24738, "cache_write": 14136, "output": 9138 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/f/filament/filament_1.9.25+dfsg3.orig.tar.xz", "your filament-1.9.25/filament/src/GPUBuffer.cpp:30:27: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "The switch in `dataTypeToSize` handles all eight `GPUBuffer::ElementType` enumerators (UINT8 through FLOAT) and returns in every case. Cppcheck's missingReturn check normally accepts a switch that covers every enumerator, so main did not warn here. `ElementType` is very likely declared as `enum class ElementType : uint8_t`. The PR now rewrites the value type of enums whose underlying type is non-standard (e.g. `uint8_t`) by overwriting the whole ValueType, which apparently loses the enum information the missingReturn check relies on. The new warning is therefore a false positive caused by the PR." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/h/html5-parser/html5-parser_0.4.12+ds1.orig.tar.gz", "main html5-parser-0.4.12/gumbo/parser.c:647:3: portability: Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 647 returns `(GumboInsertionMode)(uintptr_t)data[...]`. The pointer is explicitly cast to `uintptr_t` and then to the enum, so the function does not return an address value. Main apparently gave this cast expression a wrong (pointer) value type, which triggered CastAddressToIntegerAtReturn. The PR changes how enum value types are derived in `parsedecl`, and the warning is gone. Removing this false positive is an improvement." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/otf/otf_1.12.5+dfsg.orig.tar.gz", "main otf-1.12.5+dfsg/otflib/OTF_FileManager.c:506:2: portability: %u in format string (no. 4) requires 'unsigned int' but the argument type is 'OTF_FileStatus {aka signed int}'. [invalidPrintfArgType_uint]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`OTF_File_status()` returns `OTF_FileStatus`, a typedef'd enum, and the code passes it to `%u`. Main reported this as portability with the type 'OTF_FileStatus {aka signed int}'. That is reasonable: an enum's underlying signedness is implementation-defined, and GCC uses unsigned int when no enumerator is negative. With the PR, the same warning reappears as a plain 'warning' with type 'int'. The typedef/enum information is lost and the severity is raised. This seems to come from the changed enum handling in `parsedecl()`. The message is now less accurate and overstates the problem." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/otf/otf_1.12.5+dfsg.orig.tar.gz", "main otf-1.12.5+dfsg/otflib/OTF_FileManager.c:513:3: portability: %u in format string (no. 4) requires 'unsigned int' but the argument type is 'OTF_FileStatus {aka signed int}'. [invalidPrintfArgType_uint]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`OTF_File_status()` returns `OTF_FileStatus`, an enum typedef in C code. An enum's underlying type is implementation-defined (GCC uses unsigned int when there are no negative values), so printing it with %u is at most a portability issue. Main reported exactly that, naming the real type 'OTF_FileStatus {aka signed int}'. With the PR, the enum's type is resolved differently: the message loses the typedef/enum name and just says 'int', and the severity rises from portability to warning. This is a less accurate, more alarming message about a sign mismatch that depends on the implementation, so this line disappearing (replaced by the worse one) is a regression." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/otf/otf_1.12.5+dfsg.orig.tar.gz", "your otf-1.12.5+dfsg/otflib/OTF_FileManager.c:506:2: warning: %u in format string (no. 4) requires 'unsigned int' but the argument type is 'int'. [invalidPrintfArgType_uint]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "The argument is the return value of `OTF_File_status()`, declared as the typedef `OTF_FileStatus` (main showed it as `OTF_FileStatus {aka signed int}`). The underlying type and the %u/int mismatch are unchanged, so the warning itself stays. However, the PR changed how enum and typedef types are parsed, and Cppcheck lost the typedef's original name. The message now just says 'int', which is less informative. Losing that name also raises the severity from portability to warning, because the checker uses portability when the argument type comes from a typedef. Printing a non-negative enum or int status with %u is harmless in practice, so the portability severity fit better. The message became less accurate." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/otf/otf_1.12.5+dfsg.orig.tar.gz", "your otf-1.12.5+dfsg/otflib/OTF_FileManager.c:513:3: warning: %u in format string (no. 4) requires 'unsigned int' but the argument type is 'int'. [invalidPrintfArgType_uint]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`OTF_File_status()` returns `OTF_FileStatus`, a C enum typedef that is passed to `%u`. Main reported it as portability with the accurate type 'OTF_FileStatus {aka signed int}'. With the PR, the typedef/enum information is lost: the type is shown as plain 'int', and the severity rises from portability to warning, because the severity depends on the type token having an original typedef name. A C enum's underlying type is implementation-defined; GCC uses unsigned int when all enumerators are non-negative. So portability was the appropriate severity. The new message is less accurate and overstates the problem." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/r/r-cran-randomfields/r-cran-randomfields_3.3.14.orig.tar.gz", "your RandomFields/src/MLE.cc:381:16: style: The scope of the variable 'sorts' can be reduced. [variableScope]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`sorts` is a local array declared at function scope. Its only use is as an argument to GetNAPosition inside the `else` branch, so it could be declared inside that block. The new variableScope warning is therefore a true positive. It most likely appears because the PR now resolves the type of the `sortsofparam` enum, so the check no longer skips the variable as an unknown type." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vtk9/vtk9_9.6.2+ds.orig.tar.xz", "main vtk9-9.6.2+ds/Utilities/MetaIO/vtkmetaio/metaBlob.cxx:245:25: style: Variable 'mF' can be declared as pointer to const [constVariablePointer]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In M_Read, `mF` is passed through `reinterpret_cast(mF->value)`. If `mF` pointed to const, `mF->value` would be const, and `reinterpret_cast` cannot remove const. The code would then not compile without also changing the casts. Cppcheck normally treats a cast to a non-const pointer as possible modification, so the old warning was likely a false positive. It probably came from wrong type deduction that the PR's parsedecl changes fixed. The same pattern appears in all four removed warnings." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vtk9/vtk9_9.6.2+ds.orig.tar.xz", "main vtk9-9.6.2+ds/Utilities/MetaIO/vtkmetaio/metaLandmark.cxx:245:25: style: Variable 'mF' can be declared as pointer to const [constVariablePointer]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In vtkmetaio, `mF->value` is a `double` array member of `MET_FieldRecordType`. The code does `reinterpret_cast(mF->value)` at lines 256 and 263. If `mF` were declared `const MET_FieldRecordType *`, `mF->value` would decay to `const double*`. `reinterpret_cast` cannot cast away constness, so the code would no longer compile. The constVariablePointer suggestion was therefore a false positive, and the PR removing it is an improvement. The same pattern appears in the sibling files (metaBlob, metaLine, metaSurface)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vtk9/vtk9_9.6.2+ds.orig.tar.xz", "main vtk9-9.6.2+ds/Utilities/MetaIO/vtkmetaio/metaLine.cxx:255:25: style: Variable 'mF' can be declared as pointer to const [constVariablePointer]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`mF` is used in `reinterpret_cast(mF->value)` at lines 266 and 272, where `value` is a member array of the pointed-to struct. If `mF` were a pointer to const, `mF->value` would be const, and `reinterpret_cast` cannot cast away constness, so the code would not compile. The constVariablePointer warning was therefore a false positive. The PR improves enum value-type handling, and removing this warning is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vtk9/vtk9_9.6.2+ds.orig.tar.xz", "main vtk9-9.6.2+ds/Utilities/MetaIO/vtkmetaio/metaSurface.cxx:244:25: style: Variable 'mF' can be declared as pointer to const [constVariablePointer]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In vtkmetaio, `MET_FieldRecordType::value` is a non-const `double value[255]` array. The code does `reinterpret_cast(mF->value)` at lines 255 and 261. If `mF` were declared as `const MET_FieldRecordType *`, `mF->value` would be `const double[]`. `reinterpret_cast` cannot cast away constness, so that code would not compile. The constVariablePointer suggestion was therefore a false positive, and removing it is an improvement. The same pattern appears in the other three removed warnings. The PR's enum type changes most likely altered type information enough to remove the wrong suggestion." } } ], "started": "2026-10-13 18:38:42 UTC", "runner": "server" }