{ "tokens": { "input": 45303, "cache_read": 64543, "cache_write": 12950, "output": 20133 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "main fastText-0.9.2/src/args.cc:332:13: style: C-style pointer casting [cstyleCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`loss` is a fastText `enum class loss_name : int`, and `(char*)&loss` is the usual byte-wise serialization cast. Casting to `char*` is allowed by the aliasing rules, and the identical casts of plain `int` members (lines 326-331) get no warning at all. Under main, line 332 got a low-severity style note (cstyleCast). With the PR, that note is replaced by a 'Potentially invalid type conversion' warning (dangerousTypeCast). This comes from the new enum underlying-type handling in `parsedecl`. The message is now more severe and less accurate for a harmless cast, so this removal is part of a regression." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "main fastText-0.9.2/src/args.cc:333:13: style: C-style pointer casting [cstyleCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "In fastText, `model` is a `model_name`, declared as `enum class model_name : int`. So `(char*)&model` is the same serialization idiom as `(char*)&dim` on the lines around it, which keep their style-level cstyleCast warning. After the PR, this line no longer gets cstyleCast and instead gets a warning-level dangerousTypeCast. The likely cause: for an enum whose underlying type is plain `int`, the new code skips the branch that set the signedness. The enum's value type is then incomplete, and the cast is treated as dangerous. Casting an int-based enum to char* for byte-wise I/O is no more dangerous than casting int* to char*. The removed line is therefore replaced by a less accurate, more severe warning, which is a regression." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "main fastText-0.9.2/src/args.cc:348:11: style: C-style pointer casting [cstyleCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "In fastText, `loss` is an `enum class loss_name : int`. `(char*)&loss` is a normal byte-wise serialization cast, and `char*` may legally alias any object. It is treated exactly like the neighbouring `(char*)&dim` casts, which still get the plain style cstyleCast. The PR changed how the value type of enums with an explicit underlying type is computed. For a standard underlying type like `int`, the sign is apparently no longer set, so the enum's value type is now incomplete. As a result, Cppcheck upgrades this cast to a 'Potentially invalid type conversion' warning (dangerousTypeCast), which is not justified for a cast to `char*`. Raising severity on a harmless cast is a less accurate result and a regression." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "main fastText-0.9.2/src/args.cc:349:11: style: C-style pointer casting [cstyleCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`model` is a fastText `model_name` enum class with underlying type `int`. Casting `&model` to `char*` for raw stream I/O is valid, because char-pointer aliasing is allowed. It is the same pattern as the `int*` \u2192 `char*` casts on the neighbouring lines, which get no warning at all. Main reported this only as a style-level cstyleCast. With the PR it becomes a warning-level dangerousTypeCast claiming a \"potentially invalid type conversion\". The cause appears to be the changed enum ValueType handling: for a standard underlying type with no explicit sign, the sign is no longer set. Escalating a harmless, well-defined char* cast to a warning makes the message less accurate." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "your fastText-0.9.2/src/args.cc:332:13: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "In fastText, `loss` is an `enum class loss_name : int`. Taking `&loss` and casting it to `char*` for `ostream::write` is the usual binary-serialization idiom. Accessing an object through `char*` is always allowed by the aliasing rules, and the code is no more dangerous than the `(char*)&dim` int casts on the neighbouring lines, which keep only the style-level cstyleCast. The PR now gives enum types a `typeScope` in this path. That makes the cast check treat the enum like a class type, so the style note becomes a warning-severity dangerousTypeCast. dangerousTypeCast is meant for record/class pointer conversions, not enum-to-char serialization. The result is a less accurate, over-escalated warning." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "your fastText-0.9.2/src/args.cc:333:13: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "Line 333 casts `&model` (an enum class `model_name`, whose underlying type is `int` in fastText) to `char*` in order to write its raw bytes. Casting to `char*` is allowed by the aliasing rules and is the standard serialization idiom. The neighbouring `int` fields (`dim`, `ws`, \u2026) use the same cast and still get only the style-level cstyleCast. For the enum fields, the PR's new enum value-type handling turns this into a warning-level dangerousTypeCast. The cast is no more dangerous than the `int` ones, so the escalation is a less accurate message, likely caused by the changed enum type information (for a standard underlying type like `int`, the sign is no longer set)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "your fastText-0.9.2/src/args.cc:348:11: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "In fastText, `loss` is a `loss_name` enum class with underlying type `int`. `(char*)&(loss)` casts a pointer to char* for raw byte I/O. Casting any object pointer to char* is well-defined; it is the standard way to access an object's bytes. Cppcheck does not treat the identical `(char*)&(dim)` int* casts on the neighbouring lines as dangerous. The PR changed how the enum's value type is computed. As a result, the cast was escalated from the style-level `cstyleCast` to the warning-level `dangerousTypeCast`, which claims a potentially invalid conversion. That claim is a false positive, and the message is less accurate than before." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fasttext/fasttext_0.9.2+ds.orig.tar.xz", "your fastText-0.9.2/src/args.cc:349:11: warning: Potentially invalid type conversion in old-style C cast, clarify/fix with C++ cast [dangerousTypeCast]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`model` is an enum class member, `model_name`, which fastText declares with an `int` underlying type. Line 349 casts `&model` to `char*` to read raw bytes into it. Accessing any object through `char*` is always allowed by the aliasing rules, so this conversion is not \"potentially invalid\". Main only gave the style-level cstyleCast note. With the PR, the enum's value type changed, and Cppcheck now reports a warning-severity dangerousTypeCast for a harmless byte-wise cast. That is a false positive with a higher severity and a less accurate message." } }, { "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": "`dataTypeToSize` switches on `element.type`, a `GPUBuffer::ElementType` enum with a fixed underlying type (`uint8_t`). The switch has a case for each of the 8 enumerators, and each case returns. Cppcheck normally does not report missingReturn when a switch covers every value of an enum. The new warning most likely appears because the PR changed how ValueType is computed for enums with an explicit underlying type, and the enum's typeScope is no longer seen at the switch. As a result, the complete-switch check no longer recognizes the enum. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fzssh/fzssh_1.4.0.orig.tar.xz", "your fzssh-1.4.0/lib/transport.cpp:99:14: style: Unsigned expression 'id' can't be negative so it is unnecessary to test it. [unsignedPositive]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "The PR now resolves the underlying type of an enum declared through a typedef such as std::uint8_t, so `message_id` is treated as unsigned. That makes `id >= message_id::SSH_MSG_TRANSPORT_MIN` (where MIN appears to be 0) trigger unsignedPositive. The code is a deliberate symmetric range check written with named enum bounds; flagging it as an unnecessary test is noise. The PR itself suppresses the same pattern (enum compared with a constant of the same enum) in the less-than-zero check, but not in this positive check, so this warning is an unintended stylistic false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/i/intel-qpl/intel-qpl_1.9.0.orig.tar.xz", "your intel-qpl-1.9.0/sources/middle-layer/compression/dictionary/dictionary_utils.cpp:175:47: style: Parameter 'dictionary' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "get_load_dictionary_flag() only reads dictionary.hw_dict_level, copies it into a local enum and switches on it. It never modifies 'dictionary', so the parameter can be 'const qpl_dictionary&'. The analogous function get_dictionary_size_in_aecs() just above has the same read-only pattern. The PR improves how enum types with an explicit underlying type are understood, which most likely removed what previously suppressed this check. This is a newly found true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/j/jami/jami_20231201.0~ds2.orig.tar.gz", "main jami-20231201.0/daemon/src/account.cpp:190:13: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]" ], "verdict": { "verdict": "neutral", "confidence": "medium", "explanation": "This is the same useStlAlgorithm (std::any_of) suggestion for the same raw loop in hasActiveCodec. Only its reported location moved, from the inner condition at 190:13 to the `for` statement at 189:5. The loop really is an any_of pattern, so the warning is correct in both versions. The move is most likely a side effect of the changed enum ValueType for `MediaType`. Either location points users to the same loop, so the change does not matter to users." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/j/jami/jami_20231201.0~ds2.orig.tar.gz", "your jami-20231201.0/daemon/src/account.cpp:189:5: style: Consider using std::any_of algorithm instead of a raw loop. [useStlAlgorithm]" ], "verdict": { "verdict": "neutral", "confidence": "medium", "explanation": "The same useStlAlgorithm suggestion is still reported for the same loop. Only its location moved, from the `if` on line 190 to the `for` on line 189. The loop really is an any_of pattern (return true on the first match, otherwise return false), so the warning is a true positive either way. Pointing at the loop is just as useful as pointing at the `if`, so users are not affected." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/messagelib/messagelib_26.08.2.orig.tar.xz", "your messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.cpp:28:22: style: The comparison 'mMode == Bottom' is always true because 'mMode' and 'Bottom' represent the same value. [knownConditionTrueFalse]\n messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.h:31:24: note: 'mMode' is assigned value 'Bottom' here.\n messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.cpp:28:22: note: The comparison 'mMode == Bottom' is always true because 'mMode' and 'Bottom' represent the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The header gives mMode a default member initializer of Bottom (kwindowpositioner.h:31). However, the only constructor overrides it with `mMode(mode)` from its parameter. So inside reposition() mMode can be Right, Bottom or anything else, and `mMode == Bottom` is not always true. The new knownConditionTrueFalse warning is a false positive. The PR's enum type changes apparently let the default-initializer value leak into member value flow." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/messagelib/messagelib_26.08.2.orig.tar.xz", "your messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.cpp:45:15: style: The comparison 'mMode == Bottom' is always true because 'mMode' and 'Bottom' represent the same value. [knownConditionTrueFalse]\n messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.h:31:24: note: 'mMode' is assigned value 'Bottom' here.\n messagelib-26.08.2/messagecomposer/src/recipient/kwindowpositioner.cpp:45:15: note: The comparison 'mMode == Bottom' is always true because 'mMode' and 'Bottom' represent the same value." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The note points to kwindowpositioner.h:31, which is most likely a default member initializer (`Mode mMode = Bottom;`). The only constructor shown overrides it with `mMode(mode)` from its parameter. So mMode can be Right or Bottom at runtime, and line 26 already tests `mMode == Right`. Calling `mMode == Bottom` always true is therefore a false positive. It appeared because the PR changed how enum value types are derived, which lets the default initializer's value leak into valueflow." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nut/nut_2.8.5.orig.tar.gz", "your nut-2.8.5/common/strptime.c:319:37: style: Comparing expression of type 'unsigned int' against value 9223372036854775807. Condition is always true. [compareValueOutOfTypeRangeError]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The left operand is `(uint64_t)sse * 10`, a 64-bit unsigned value, and it is compared against INT64_MAX. That comparison can be either true or false, which is the purpose of the overflow guard in this loop. The new warning treats the expression as 'unsigned int', a 32-bit type, and so concludes the condition is always true. That type is wrong. The PR's parsedecl changes (the `isName` \u2192 `isNameOnly` change and the new enum/typedef handling) appear to have broken type deduction for this cast, producing a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nut/nut_2.8.5.orig.tar.gz", "your nut-2.8.5/common/strptime.c:322:36: style: Comparing expression of type 'unsigned int' against value 9223372036854775807. Condition is always false. [compareValueOutOfTypeRangeError]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`(uint64_t)sse` is a 64-bit unsigned value, and `TIME_MAX` is INT64_MAX, so `(uint64_t)sse > TIME_MAX` can be true. The PR changed how type declarations are parsed (`isName` became `isNameOnly`, plus the new enum handling). As a result, Cppcheck now wrongly treats the `uint64_t` cast as 'unsigned int' and reports this comparison as always false. This is a new false positive caused by a wrong value type." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz", "main qtdeclarative-everywhere-src-5.15.19/src/3rdparty/masm/yarr/YarrPattern.h:346:27: performance: Function parameter 'term' should be passed by const reference. [passedByValue]" ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`TermChain(PatternTerm term)` takes `PatternTerm` by value and only copies it into the member. In Yarr, `PatternTerm` is a sizeable struct with a uint8_t-based enum, bitfields, a union holding pointers and structs, and several unsigned counters. That is well above the size threshold, so passing it by const reference is a valid suggestion and the main warning was a true positive. The PR changes how enums with an explicit underlying type (such as `uint8_t`) get their value type. This likely broke Cppcheck's size estimate for `PatternTerm`, which silently dropped the warning. The code is unchanged, so this is a lost true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz", "your qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: style: Condition 'm_dataType&External' is always false [knownConditionTrueFalse]\n qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:323:43: note: Assignment 'm_dataType=static_cast(sizeof(char)*8)', assigned value is 8\n qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: note: Condition 'm_dataType&External' is always false" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In the else branch, `m_dataType` is set to `sizeof(Number) * 8`, which is always a multiple of 8 (8, 16, 32, 64). `External` is a low flag bit in Qt's `Type` enum (believed to be 1; not shown in the excerpt). So `m_dataType & External` on the next line is always false, and the ternary always picks `&m_data`. The condition is redundant, so this is a true positive. It now appears because the PR resolves the enum's typedef'd underlying type (`quint16`), which lets value flow track the assigned value." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/q/qtdeclarative-opensource-src/qtdeclarative-opensource-src_5.15.19+dfsg.orig.tar.xz", "your qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: style: Condition 'm_dataType&External' is always false [knownConditionTrueFalse]\n qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:323:43: note: Assignment 'm_dataType=static_cast(sizeof(qint8)*8)', assigned value is 8\n qtdeclarative-everywhere-src-5.15.19/src/qmldebug/qqmlprofilerevent_p.h:324:53: note: Condition 'm_dataType&External' is always false" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In the else branch, `m_dataType` is assigned `sizeof(Number) * 8`, which is always a multiple of 8. In Qt's `QQmlProfilerEvent`, `External` is the low bit (1), so `m_dataType & External` is always false right after that assignment, whatever `Number` is. The ternary on line 324 is redundant, and the knownConditionTrueFalse warning is a true positive. The PR now resolves the enum's underlying type through the typedef (`quint16`), which likely lets value flow track the value, so this is a newly found correct warning." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/r/rsyslog/rsyslog_8.2608.0.orig.tar.gz", "main rsyslog-8.2608.0/runtime/conf.c:149:46: style: Parameter 'pVal' can be declared as pointer to const. However it seems that 'doNameLine' is a callback function, if 'pVal' is declared with const you might also need to cast function pointer(s). [constParameterCallback]\n rsyslog-8.2608.0/runtime/conf.c:558:23: note: You might need to cast the function pointer here\n rsyslog-8.2608.0/runtime/conf.c:149:46: note: Parameter 'pVal' can be declared as pointer to const" ], "verdict": { "verdict": "regression", "confidence": "low", "explanation": "In `doNameLine`, `pVal` is only read: it is cast by value to `enum eDirective` and never dereferenced or written. Declaring it `const void *` would therefore be valid. That makes the `constParameterCallback` warning, which already mentions the callback cast, technically correct. The PR only changes how enum value types are computed, so the warning most likely disappeared as a side effect. Cppcheck now probably treats the cast to an enum type as a possible non-const use, not because it understands the code better. This looks like a lost true positive, although the warning is of limited practical value." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/simulpic/simulpic_2005-1-28.orig.tar.gz", "main simulpic-2005-1-28/tpic.cc:758:42: performance: Function parameter 'Inputs' should be passed by const reference. [passedByValue]" ], "verdict": { "verdict": "regression", "confidence": "low", "explanation": "`TInput_State` is a struct holding the `RA[5]` and `RB[8]` pin-state arrays. It is passed by value, only read, and then copied into `New_Input_State`. A const reference would work fine.\n\nThe elements are compared against the enum-like constant `OUT`, so they are most likely 4-byte enum values. That makes the struct roughly 52 bytes, well above the passedByValue threshold of two pointer sizes, so the warning in main looks like a true positive.\n\nThe PR changes how enum value types are computed: it no longer overwrites an already-set type, and it uses `isNameOnly` instead of `isName`. The likely cause of the lost warning is that the struct's estimated size became smaller or unknown, not that the code improved. So the removal is probably a lost true positive.\n\nConfidence is low because the definition of `TInput_State` is not shown." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vifm/vifm_0.14.4.orig.tar.gz", "main vifm-0.14.4/src/filelist.c:4437:2: portability: Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The line `return (FoldState)(uintptr_t)data;` explicitly converts the pointer to `uintptr_t` and then to the enum type `FoldState`. The returned expression is therefore an integer/enum value, not an address. Main's CastAddressToIntegerAtReturn warning was a false positive, most likely because the cast's value type was misdeduced. The PR fixes how enum value types are parsed (the cast now resolves to the enum type), and the bogus portability warning goes away." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xdg-dbus-proxy/xdg-dbus-proxy_0.1.9.orig.tar.xz", "main xdg-dbus-proxy-0.1.9/flatpak-proxy.c:1239:7: portability: Returning an address value in a function with integer return type is not portable. [CastAddressToIntegerAtReturn]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 1239 returns `GPOINTER_TO_UINT(type)`. This is GLib's standard idiom for explicitly converting a pointer-stored integer back to `guint`. The function returns the enum `ExpectedReplyType`, and the value really is a small integer that was stored with `GUINT_TO_POINTER`. Warning that an address is being returned as an integer is therefore a false positive. The PR changes how enum return types get their value type, and that change removes this warning. It is not fully clear exactly why the change suppresses it, but losing this false positive is good for users." } } ], "started": "2026-10-22 08:18:50 UTC", "runner": "aws-testrunner-1" }