{ "tokens": { "input": 280878, "cache_read": 53142, "cache_write": 9378, "output": 29654 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/a/audacity/audacity_4.0.1+dfsg.orig.tar.xz", "your audacity-4.0.1/au3/libraries/au3-stretching-sequence/tests/StretchingSequenceTest.cpp:93:40: style: Argument 'factory->callCount==refCount' to function REQUIRE is always 1. It does not matter what value 'callCount' has. [knownArgument]\n audacity-4.0.1/au3/libraries/au3-stretching-sequence/tests/StretchingSequenceTest.cpp:88:33: note: refCount is assigned 'factory->callCount' here.\n audacity-4.0.1/au3/libraries/au3-stretching-sequence/tests/StretchingSequenceTest.cpp:93:40: note: Argument 'factory->callCount==refCount' to function REQUIRE is always 1. It does not matter what value 'callCount' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The PR now treats operands that carry only impossible int values as hidden variables, which lets this new warning through. The claim that 'factory->callCount==refCount' is always 1 is false. 'factory' is a raw pointer to an object owned by 'sut'. The intervening calls to 'sut.GetFloats(...)' can change 'factory->callCount', and later lines expect exactly that ('refCount + 1'). Cppcheck misses this aliasing through the unique_ptr, so the known value is wrong. The new warning is a false positive on a meaningful test assertion." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/audacity/audacity_4.0.1+dfsg.orig.tar.xz", "your audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:989:55: style: Argument 'highlight&&gripHit' to function DrawTimeSlider is always 0. It does not matter what value 'gripHit' has. [knownArgument]\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:970:22: note: Assignment 'highlight=false', assigned value is 0\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:980:51: note: Assuming container is not empty\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:988:9: note: Assuming condition is true\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:989:55: note: Argument 'highlight&&gripHit' to function DrawTimeSlider is always 0. It does not matter what value 'gripHit' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Both `highlight` and `gripHit` are initialized to false and never changed, so `highlight && gripHit` passed to DrawTimeSlider is always false. The new knownArgument warning is factually correct and points at leftover code from the removed experimental drawing. It appears now because the PR lets the check consider variables whose first value is an impossible int value. The wording is slightly odd, since gripHit is also known to be false, but the reported fact is true and worth a user's attention." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/audacity/audacity_4.0.1+dfsg.orig.tar.xz", "your audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:990:56: style: Argument 'highlight&&gripHit' to function DrawTimeSlider is always 0. It does not matter what value 'gripHit' has. [knownArgument]\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:970:22: note: Assignment 'highlight=false', assigned value is 0\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:980:51: note: Assuming container is not empty\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:988:9: note: Assuming condition is true\n audacity-4.0.1/au3/src/tracks/playabletrack/wavetrack/ui/WaveformView.cpp:990:56: note: Argument 'highlight&&gripHit' to function DrawTimeSlider is always 0. It does not matter what value 'gripHit' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "In `DoDraw`, `highlight` and `gripHit` are both local bools initialized to `false` and never changed. So `highlight && gripHit` passed to `DrawTimeSlider` is always false, and the new knownArgument warning is factually correct. It points at leftover placeholder or dead logic, which is exactly what this check targets. Before the PR it was missed only because `gripHit` carried impossible bool values (<0, >1). The PR deliberately treats such variables like ones with no values, so the new warning is a legitimate true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/b/botan/botan_2.19.5+dfsg.orig.tar.xz", "your botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:287:64: style: Argument 'end-start' to function substr is always 88. It does not matter what value 'start' has. [knownArgument]\n botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:283:24: note: Assuming that condition '(end-start)!=88' is not redundant\n botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:287:64: note: Argument 'end-start' to function substr is always 88. It does not matter what value 'start' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "Line 283 throws unless `end - start == 88`, so at line 287 `end-start` is 88 only because of that earlier guard. The expression itself is not constant: it is a normal, readable substring length. `knownArgument` is meant for expressions like `0*x` or `x*0`, which are constant whatever the variable is. Here the claim \"It does not matter what value 'start' has\" is misleading, because the value does depend on `start` and `end`; the check just constrained them. The PR now accepts variables whose only values are impossible ones (such as `end != npos`). That lets this flow-derived result through and adds a noisy, misleading style warning for idiomatic code, so it is a false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/b/botan/botan_2.19.5+dfsg.orig.tar.xz", "your botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:288:99: style: Argument 'end-start' to function substr is always 88. It does not matter what value 'start' has. [knownArgument]\n botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:283:24: note: Assuming that condition '(end-start)!=88' is not redundant\n botan-2.19.5+dfsg/src/lib/misc/roughtime/roughtime.cpp:288:99: note: Argument 'end-start' to function substr is always 88. It does not matter what value 'start' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "Line 283 throws unless `end - start == 88`. So at line 288, `end-start` is 88 only because of that earlier check. It is not a constant expression that hides a variable, like `0*x`. The message \"It does not matter what value 'start' has\" is misleading: the value of start does matter, and only the difference is constrained. Passing `end-start` to substr is natural, readable code that users would not change to a literal 88. The PR now lets variables with impossible values through, which turns condition-derived known values into new knownArgument false positives." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/d/ddcutil/ddcutil_2.2.7.orig.tar.gz", "your rockowitz-ddcutil-d6050d6/src/ddc/ddc_initial_checks.c:509:38: style: Argument 'debug||true' to function DBGTRC_NOPREFIX is always 1. Constant literal calculation disable/hide variable expression 'debug'. [knownArgumentHiddenVariableExpression]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`debug || true` always evaluates to 1, so the value of `debug` has no effect on the argument. This is exactly the pattern the check targets; the existing tests already flag `true||x`. Main missed it only because `debug` (a bool) carries impossible values (<0 / >1), which made `child->values()` non-empty. The PR treats impossible-only values like no values, so the result is consistent with the check's design and the message is accurate. The developer probably forced tracing on purpose, but the style note correctly points out that `debug` is effectively ignored." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:452:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:452:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:452:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument is `!storage->safe_buffer_sub_data(...)`. Cppcheck treats it as constant only because, in the configuration it analysed (no DEBUG_ENABLED), `safe_buffer_sub_data` always returns true. With DEBUG_ENABLED the function returns false when the write would run past the buffer, so the check is meaningful and depends on the configuration. The message is also wrong in substance: `data.polygon_buffer_size` is not hidden by a constant literal calculation like `0*x`. It is just a parameter of a call whose result Cppcheck thinks is known. The warning appeared because the PR now accepts variables that carry only impossible values; an unsigned member typically gets an impossible '<0' value. The result is a noisy false positive, repeated across all similar RAST_FAIL_COND calls." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:459:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:459:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:459:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "safe_buffer_sub_data is a bounds-checking helper that returns false when the write would overflow data.polygon_buffer_size, so the argument is not always 0. Cppcheck seems to have taken one return path ('returns 1') as the only result, which is a separate weakness. Before the PR, the check bailed out because the variable had values. The PR now accepts variables whose first value is an impossible int value, and that exposes this wrong known-value result. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:468:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(float)*4*p_vertex_count,p_weights,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:468:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:468:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(float)*4*p_vertex_count,p_weights,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`safe_buffer_sub_data` returns a constant `true` only when `DEBUG_ENABLED` is not defined. With `DEBUG_ENABLED` it returns `false` if the write would cross the buffer edge. So the constant result is configuration-dependent, and the `RAST_FAIL_COND` check is meaningful defensive code. The knownArgument check is meant for literal arithmetic that hides a variable, such as `0*x`. Here `data.polygon_buffer_size` is just an argument passed to a function, and nothing hides it. The PR now accepts variables whose first value is an impossible int value (an unsigned member gets impossible negative values). That lets this function-call case through and produces a misleading 'does not matter what value' warning. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:473:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(int)*4*p_vertex_count,p_bones,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:473:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:473:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(int)*4*p_vertex_count,p_bones,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`safe_buffer_sub_data` returns false only under `#ifdef DEBUG_ENABLED`, when the write would overrun the buffer. In non-debug builds it always returns true, so the argument being 0 depends on the build configuration and is not a real logic issue. The argument is also a function call inside an error-guard macro. It is not a constant literal calculation that hides a variable, which is what knownArgument is meant to catch. Saying 'it does not matter what value data.polygon_buffer_size has' is misleading, because that value is exactly what decides the result in debug builds. The PR now accepts variables whose first value is impossible (here unsigned >= 0), so this new false positive appears." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:531:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:531:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:531:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "The argument is `!storage->safe_buffer_sub_data(...)`. In Godot, `safe_buffer_sub_data` returns false only inside an `#ifdef DEBUG_ENABLED` bounds check, so it is constant only in the non-debug configuration Cppcheck analysed. This is a deliberate safety check whose result depends on the build configuration, so flagging it is noise. The message is also misleading: it says it doesn't matter what value `data.polygon_buffer_size` has, but the constant comes from the function's return value, not from a literal hiding a variable. The PR now treats a variable that only has impossible values like one with no values, which causes these new false positives (and similar ones on ERR_FAIL_COND checks elsewhere)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:538:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:538:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:538:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument is the negated result of a function call, `!storage->safe_buffer_sub_data(...)`. It is not a variable expression hidden by a constant calculation. `safe_buffer_sub_data` returns true unconditionally only when DEBUG_ENABLED is not defined; in debug builds it returns false on overflow. Calling it is the whole point, since it uploads data and sets `buffer_ofs_after`. Saying 'it does not matter what value data.polygon_buffer_size has' is misleading. The PR now also accepts variables that carry only impossible values; the unsigned `data.polygon_buffer_size` probably has one, which seems to be what made this warning appear. The result is a new false positive in a config-dependent assert macro." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:574:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:574:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:574:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "In Godot, `safe_buffer_sub_data` returns false only inside `#ifdef DEBUG_ENABLED`, when the write would overflow the buffer. Otherwise it returns true. Cppcheck checked the non-debug configuration, saw that the function always returns 1, and reported that the RAST_FAIL_COND argument is always 0. That is a configuration artifact: in debug builds the check is meaningful and intended. The message is also misleading. `data.polygon_buffer_size` is not hidden by a constant literal calculation; it is just an argument to a call whose result happens to be constant in one configuration. The PR now treats variables that have only impossible values as unknown, and that lets these new noisy warnings through. It is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:581:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:581:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles2/rasterizer_canvas_base_gles2.cpp:581:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument is `!storage->safe_buffer_sub_data(...)`. It is a function call result, not a constant calculation that hides a variable. Cppcheck only knows the call returns 1 because, without DEBUG_ENABLED, `safe_buffer_sub_data` skips its bounds check and always returns true. With DEBUG_ENABLED it can return false, so the check is meaningful and depends on the configuration. Saying 'It does not matter what value data.polygon_buffer_size has' is wrong: that variable is passed into the function and decides the result in debug builds. The PR now accepts variables with impossible values (here, an unsigned value that cannot be negative), so these noisy false positives appear across the GLES2/GLES3 drivers." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:359:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:359:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:359:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`safe_buffer_sub_data` returns false only under `#ifdef DEBUG_ENABLED`; otherwise it always returns true. So the constant result depends on the build configuration, and the `RAST_FAIL_COND` macro is a deliberate safety check. The knownArgument check targets literal calculations that hide a variable, such as `0*x`. This argument is a function call result, and `data.polygon_buffer_size` is just one of its parameters. The claim \"it does not matter what value 'data.polygon_buffer_size' has\" is misleading. The warning only appears because the PR now accepts variables whose first value is impossible; an unsigned member has impossible negative values. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:366:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:366:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:366:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "Godot's `safe_buffer_sub_data()` returns false only inside `#ifdef DEBUG_ENABLED`, when the write would cross the buffer end; otherwise it returns true. Cppcheck analyzed the non-debug configuration, so it concluded the call always returns 1 and the `RAST_FAIL_COND` argument is always 0. That holds only for this configuration: in debug builds the check is meaningful and does depend on `data.polygon_buffer_size`. So the claim \"It does not matter what value 'data.polygon_buffer_size' has\" is wrong in general. The knownArgument check is meant for literal calculations that hide a variable (like `0*x`), not for configuration-dependent function return values passed to a check macro. The PR's relaxed condition (accepting variables with impossible values) let this noisy false positive through, along with many similar new warnings in this package." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:376:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(int)*4*p_vertex_count,p_bones,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:376:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:376:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(int)*4*p_vertex_count,p_bones,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument is a call to `safe_buffer_sub_data()`. In Godot this function returns false when the write would overflow the buffer, but only under `#ifdef DEBUG_ENABLED`; otherwise it always returns true. So Cppcheck's 'always 0' comes from analysing one preprocessor configuration only. The call is a real runtime safety check, not a constant expression that hides a variable. The message is also misleading: `data.polygon_buffer_size` does matter in debug builds. The PR now also accepts variables that carry only impossible values, which is why this warning newly appears. It is a false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:382:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(float)*4*p_vertex_count,p_weights,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:382:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:382:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(float)*4*p_vertex_count,p_weights,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`safe_buffer_sub_data` returns false only inside `#ifdef DEBUG_ENABLED`. In the configuration Cppcheck analysed, it always returns true, so `RAST_FAIL_COND(!...)` looks constant. That is a deliberate error check whose result depends on the build configuration, not redundant code. The message is also misleading: it blames 'data.polygon_buffer_size', which is not hidden by any constant literal calculation. The warning now appears because the PR also accepts variables whose only value is an impossible one (unsigned >= 0). This adds a false positive, so it is a regression." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:440:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:440:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:440:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`safe_buffer_sub_data` returns false when the write would overrun the buffer, but only under `#ifdef DEBUG_ENABLED`. In the configuration Cppcheck analysed, the function always returns true, so `!safe_buffer_sub_data(...)` looks constant. That is a configuration artifact. The `RAST_FAIL_COND` check is an intentional defensive check, not a constant expression hiding a variable. The knownArgument check targets literal calculations that hide a variable, such as `0*x`. Here the value comes from a function call's return. The PR now accepts `data.polygon_buffer_size` because it has an impossible int value, which produces these misleading new warnings. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:447:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:447:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:447:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "`safe_buffer_sub_data` returns false only inside an `#ifdef DEBUG_ENABLED` size check; otherwise it always returns true. In the configuration Cppcheck analyzed, the function was seen as returning 1. The argument to RAST_FAIL_COND is a configuration-dependent sanity check, not a constant calculation that hides a variable. The claim that 'data.polygon_buffer_size' does not matter is wrong, because in debug builds that size decides the result. The PR now accepts variables that carry impossible values, and that lets this noisy, misleading warning through. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:489:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:489:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:489:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Color)*p_vertex_count,p_colors,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument is `!storage->safe_buffer_sub_data(...)`. That function only returns false inside an `#ifdef DEBUG_ENABLED` bounds check, so in the analysed configuration Cppcheck infers it always returns true. The result is configuration-dependent, and in debug builds the call can fail. The macro argument is a deliberate runtime safety check, not a constant expression hiding a variable, so the claim that 'data.polygon_buffer_size' does not matter is misleading. The warning only appears because the PR now accepts variables whose first value is an impossible int value. `data.polygon_buffer_size` is unsigned, so it always carries an impossible value of < 0, which makes the condition far too broad. This is a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:496:18: style: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:496:48: note: Calling function 'safe_buffer_sub_data' returns 1\n godotengine-godot-3cd3caa/drivers/gles3/rasterizer_canvas_base_gles3.cpp:496:18: note: Argument '!storage->safe_buffer_sub_data(data.polygon_buffer_size,GL_ARRAY_BUFFER,buffer_ofs,sizeof(Vector2)*p_vertex_count,p_uvs,buffer_ofs_after)' to function RAST_FAIL_COND is always 0. It does not matter what value 'data.polygon_buffer_size' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "Line 496 passes `!storage->safe_buffer_sub_data(...)` to the RAST_FAIL_COND guard. In Godot, `safe_buffer_sub_data` returns false only inside an `#ifdef DEBUG_ENABLED` bounds check; otherwise it always returns true. Cppcheck analysed the build without DEBUG_ENABLED and concluded the call always returns 1. That is a configuration artifact: the call is a real runtime check in debug builds. The message is also misleading. It blames 'data.polygon_buffer_size' as if a constant expression hid it, but nothing here is a constant literal calculation. The new warning appears only because the PR now accepts variables whose first value is impossible, which goes beyond the intended `0*x` case. This is a new false positive and noise for users." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/drivers/gles3/shader_gles3.cpp:1020:28: style: Argument 'iloglen<0' to function ERR_FAIL_COND_V is always 1. It does not matter what value 'iloglen' has. [knownArgument]\n godotengine-godot-3cd3caa/drivers/gles3/shader_gles3.cpp:1016:15: note: Assuming that condition 'iloglen<0' is not redundant\n godotengine-godot-3cd3caa/drivers/gles3/shader_gles3.cpp:1020:28: note: Argument 'iloglen<0' to function ERR_FAIL_COND_V is always 1. It does not matter what value 'iloglen' has." ], "verdict": { "verdict": "regression", "confidence": "medium", "explanation": "The ERR_FAIL_COND_V(iloglen < 0, false) call is inside `if (iloglen < 0)`, so the argument is indeed always true. But this is a deliberate error-reporting idiom: the macro is used for its side effects (print the error and return), and the redundancy comes from the enclosing condition. knownArgument is meant for constant literal calculations that hide a variable, such as `0*x`. The message 'It does not matter what value iloglen has' is wrong, because the result depends entirely on iloglen. The PR now accepts variables whose first value is impossible, which lets flow-derived conditions trigger knownArgument. That produces noisy or misleading warnings like this one and the others in the package." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/modules/fbx/data/fbx_material.cpp:306:25: style: Argument 'desc==PROPERTY_DESC_NOT_FOUND' to function ERR_CONTINUE_MSG is always 0. It does not matter what value 'desc' has. [knownArgument]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "`desc == PROPERTY_DESC_NOT_FOUND` is always false at line 306 only because of the `continue` at lines 302-303. That comes from data flow: `desc` gets the impossible value NOT_FOUND. It is not a constant literal calculation hiding a variable. The knownArgument message says 'It does not matter what value 'desc' has', which is wrong: the result depends entirely on `desc`. The code is at most a redundant check, which belongs under knownConditionTrueFalse. The PR now accepts variables with impossible values, so knownArgument fires for ordinary flow-derived conditions it used to skip. This one is a false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/scene/resources/texture.cpp:476:76: style: Argument 'header[0]!='G'||header[1]!='D'||header[2]!='S'||header[3]!='T'' to function ERR_FAIL_COND_V is always 1. It does not matter what value 'header[0]' has. [knownArgument]\n godotengine-godot-3cd3caa/scene/resources/texture.cpp:474:63: note: Assuming that condition 'header[0]!='G'||header[1]!='D'||header[2]!='S'||header[3]!='T'' is not redundant\n godotengine-godot-3cd3caa/scene/resources/texture.cpp:476:76: note: Argument 'header[0]!='G'||header[1]!='D'||header[2]!='S'||header[3]!='T'' to function ERR_FAIL_COND_V is always 1. It does not matter what value 'header[0]' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 476 sits inside `if (header[0] != 'G' || ... || header[3] != 'T')`, and the `ERR_FAIL_COND_V` call repeats exactly the same condition. Inside that branch the argument is necessarily true, so 'always 1' is factually correct. The repeated check is redundant and could be replaced by an unconditional fail such as `ERR_FAIL_V`. The PR deliberately extends knownArgument to variables that carry impossible values from an enclosing condition. This is the same pattern as the new test case (#15145). The warning is a valid, if minor, style finding rather than a false positive. Some users may see it as noise because it comes from a macro-based error-handling idiom." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/servers/physics/collision_solver_sat.cpp:241:30: style: Argument 'num_points>=max_clip' to function ERR_FAIL_COND is always 0. It does not matter what value 'num_points' has. [knownArgument]\n godotengine-godot-3cd3caa/servers/physics/collision_solver_sat.cpp:217:17: note: Assuming that condition 'num_points<2' is not redundant\n godotengine-godot-3cd3caa/servers/physics/collision_solver_sat.cpp:233:16: note: Assuming condition is true\n godotengine-godot-3cd3caa/servers/physics/collision_solver_sat.cpp:239:27: note: Assuming condition is true\n godotengine-godot-3cd3caa/servers/physics/collision_solver_sat.cpp:241:30: note: Argument 'num_points>=max_clip' to function ERR_FAIL_COND is always 0. It does not matter what value 'num_points' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "Inside the `if (num_points < 2)` block, `num_points >= max_clip` is false only because of the earlier condition. It is a deliberate defensive assert (`ERR_FAIL_COND`). The knownArgument check is meant for constant calculations that hide a variable, like `x*0`. Here the result depends directly on `num_points`, so the message 'It does not matter what value num_points has' is wrong. The PR now accepts variables whose first value is an impossible int value, and this case slipped through. The new warning is noise on an intentional safety check." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/godot3/godot3_3.6.2+ds.orig.tar.xz", "your godotengine-godot-3cd3caa/servers/visual/portals/portal_tracer.cpp:298:28: style: Argument 'p_depth>8' to function ERR_FAIL_COND_MSG is always 0. It does not matter what value 'p_depth' has. [knownArgument]\n godotengine-godot-3cd3caa/servers/visual/portals/portal_tracer.cpp:293:14: note: Assuming that condition 'p_depth>1' is not redundant\n godotengine-godot-3cd3caa/servers/visual/portals/portal_tracer.cpp:298:28: note: Argument 'p_depth>8' to function ERR_FAIL_COND_MSG is always 0. It does not matter what value 'p_depth' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 293 returns early when `p_depth > 1`, so at line 298 `p_depth <= 1` always holds. That makes `p_depth > 8` always false, and the 'Portal Depth Limit reached' guard can never fire. The `p_depth > 1` early return looks like leftover debug code that makes the depth-limit check dead. The PR now handles variables whose only values are impossible ranges, so Cppcheck correctly finds that this argument is always 0. This is a true positive about redundant or dead code. The knownArgument wording ('does not matter what value p_depth has') is somewhat awkward for a comparison, but the finding is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:103:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:103:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:103:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:103:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The new warning is a true positive. In `index > 0 || index < this->size()`, `size()` returns 8. If `index > 0` is false, then `index <= 0`, so `index < 8` is always true. The argument is therefore always 1, whatever `index` is. This is a real bug in the code: it should probably be `index >= 0 && index < size()`. Before the PR, the check skipped `index` because its only value was an impossible value from the left side of `||`. The PR now accepts such variables, which lets Cppcheck find this genuine always-true precondition." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:110:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:110:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:110:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:110:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`size()` returns 8, so the precondition is `index > 0 || index < 8`. Any int that is not > 0 is <= 0, which is < 8, so the argument is always true and the bounds check never fires. The author clearly meant `index >= 0 && index < size()`. The new knownArgument warning is a true positive that points at a real bug." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:117:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:117:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:117:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:117:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The precondition `index > 0 || index < this->size()` uses `||`, and `size()` always returns 8. Any int that is not > 0 is <= 0, which is < 8, so the argument is always true and the bounds check never fires. The intended check was probably `index >= 0 && index < size()`. The new knownArgument warning flags a real bug, so it is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:124:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:124:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:124:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:124:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The precondition is `index > 0 || index < this->size()`, and `size()` always returns 8. If `index > 0` is false, then `index <= 0`, so `index < 8` is true. The argument is therefore always 1 whatever `index` is. This is a genuine bug: the author almost certainly meant `index >= 0 && index < size()`, and as written the bounds check never fires. The PR now lets the check work on the variable even when it only has impossible values (here inferred from the `index > 0` condition). That newly exposes this true positive, so the new warning is correct and useful." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:89:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:89:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:89:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:89:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The precondition `index > 0 || index < this->size()` is always true. If index > 0, the first operand is true. Otherwise index <= 0, and with size() returning 8, `index < 8` holds. The check is a real bug: it was clearly meant to be `index >= 0 && index < size()`, so it never catches an out-of-bounds index. The newly added knownArgument warning is a true positive and its message is accurate." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libv/libvigraimpex/libvigraimpex_1.12.4+dfsg.orig.tar.xz", "your vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:96:38: style: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has. [knownArgument]\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:96:34: note: Assuming that condition 'index>0' is not redundant\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:96:59: note: Calling function 'size' returns 8\n vigra-Version-1-12-4/test/classifier/data/RF_data.hxx:96:38: note: Argument 'index>0||indexsize()' to function vigra_precondition is always 1. It does not matter what value 'index' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The precondition `index > 0 || index < this->size()` is a tautology. If `index > 0` is false, then `index <= 0`, which is always less than `size()` (8). So the argument is always true and the bounds check does nothing; the intended check was probably `index >= 0 && index < size()`. The new knownArgument warning points at a real logic bug, so it is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/megaglest/megaglest_3.13.0.orig.tar.xz", "your megaglest-3.13.0/source/glest_game/ai/path_finder.cpp:213:40: style: Argument 'frameIndex<0' to function setTargetPos is always 1. It does not matter what value 'frameIndex' has. [knownArgument]\n megaglest-3.13.0/source/glest_game/ai/path_finder.cpp:205:19: note: Assuming that condition 'frameIndex<0' is not redundant\n megaglest-3.13.0/source/glest_game/ai/path_finder.cpp:206:89: note: Assuming condition is false\n megaglest-3.13.0/source/glest_game/ai/path_finder.cpp:213:40: note: Argument 'frameIndex<0' to function setTargetPos is always 1. It does not matter what value 'frameIndex' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 213 sits inside `if(frameIndex < 0)` (line 205), and `frameIndex` is not changed between the check and the call. So the argument `frameIndex < 0` passed to `setTargetPos` is always true and could simply be `true`. Before this PR, the check skipped `frameIndex` because its value list was not empty (it held impossible values). The PR now handles that case, matching its intent (#15145). The new warning is a correct, if purely stylistic, true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/openfpgaloader/openfpgaloader_0.13.1.orig.tar.gz", "your openFPGALoader-0.13.1/src/jlink.cpp:474:24: style: Argument '_caps&EMU_CAP_GET_HW_VERSION' to function printf is always 0. It does not matter what value '_caps' has. [knownArgument]\n openFPGALoader-0.13.1/src/jlink.cpp:472:6: note: Assuming that condition '!(_caps&EMU_CAP_GET_HW_VERSION)' is not redundant\n openFPGALoader-0.13.1/src/jlink.cpp:474:24: note: Argument '_caps&EMU_CAP_GET_HW_VERSION' to function printf is always 0. It does not matter what value '_caps' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "Line 474 is inside `if (!(_caps & EMU_CAP_GET_HW_VERSION))`, so `_caps & EMU_CAP_GET_HW_VERSION` is always 0 there, and printing it is pointless. The PR now treats a variable carrying only impossible values like one with no values, so this case is reported. The wording 'It does not matter what value _caps has' is a bit loose, since it is the branch condition that makes the value 0. Still, the warning points at genuinely redundant code, so it is a true positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/r/ruby3.4/ruby3.4_3.4.11.orig.tar.xz", "your ruby-3.4.11/ext/-test-/bignum/intpack.c:16:87: style: Argument 'wordsize*numwords' to function rb_str_new is always 0. It does not matter what value 'wordsize' has. [knownArgument]\n ruby-3.4.11/ext/-test-/bignum/intpack.c:7:21: note: Assignment 'numwords=0', assigned value is 0\n ruby-3.4.11/ext/-test-/bignum/intpack.c:16:87: note: Argument 'wordsize*numwords' to function rb_str_new is always 0. It does not matter what value 'wordsize' has." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`numwords` is initialised to 0 and never changed; the value passed to `rb_integer_pack` is a separate `NUM2SIZET(numwords_arg)`. So `wordsize * numwords` really is always 0, and `rb_str_new` always gets length 0. That looks like a real bug in this test helper. Before the PR, the check was skipped because `wordsize` (a `size_t`) carried an impossible value (e.g. <0). The PR now lets such operands through, so this true positive is newly reported." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/source-extractor/source-extractor_2.29.0+ds.orig.tar.xz", "your sextractor-2.29.0/src/fits/fitsbody.c:154:53: style: Argument '(spoonful=(4*(1024*1024)))/sizeof(PIXTYPE)' to function read_body is always 1048576. It does not matter what value 'spoonful' has. [knownArgument]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument `(spoonful=DATA_BUFSIZE)/sizeof(PIXTYPE)` deliberately assigns `spoonful` and passes the result, and `spoonful` is used again on the next lines. The constant value is intentional, and no variable is hidden by a constant calculation. The claim \"It does not matter what value 'spoonful' has\" is meaningless here because `spoonful` is the target of the assignment. The PR now accepts variables that carry only impossible values, so the assignment LHS `spoonful` gets picked as the variable. That turns idiomatic code into a new false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/source-extractor/source-extractor_2.29.0+ds.orig.tar.xz", "your sextractor-2.29.0/src/fits/fitsbody.c:260:54: style: Argument '(spoonful=(4*(1024*1024)))/sizeof(unsigned int)' to function read_ibody is always 1048576. It does not matter what value 'spoonful' has. [knownArgument]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The argument `(spoonful=DATA_BUFSIZE)/sizeof(FLAGTYPE)` assigns a constant to `spoonful` and passes the result. `spoonful` is the target of the assignment, not an input whose value is hidden, and the assigned value is used afterwards (func call, QFWRITE). The message \"It does not matter what value 'spoonful' has\" is therefore a false positive. The PR's relaxed condition, which now accepts variables whose values are impossible-int values, lets this assignment pattern trigger the check." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/w/wavbreaker/wavbreaker_0.16.orig.tar.gz", "your wavbreaker-0.16/src/sample.c:427:105: style: Argument 'sample_info->blockSize*i' to function read_sample is always 0. It does not matter what value 'sample_info->blockSize' has. [knownArgument]\n wavbreaker-0.16/src/sample.c:425:9: note: Assignment 'i=0', assigned value is 0\n wavbreaker-0.16/src/sample.c:427:105: note: Argument 'sample_info->blockSize*i' to function read_sample is always 0. It does not matter what value 'sample_info->blockSize' has." ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "At line 425 `i = 0` is assigned, and line 427 passes `sample_info->blockSize * i` to read_sample. That argument is always 0, so the value of blockSize really does not matter. Before the PR, `blockSize` was skipped as the hidden variable because it carried a value (most likely an impossible 0, from the division at line 405). The PR deliberately accepts variables whose first value is an impossible int value, and that is why this warning now appears. The diagnostic is factually correct and fits the knownArgument check's purpose of flagging a constant argument that hides a variable. It is a stylistic true positive: the code could just pass 0. Some users may see it as low-value noise, since the author probably wrote it this way to mirror the later reads in the loop." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/x/xwpe/xwpe_1.6.6.orig.tar.xz", "your xwpe-1.6.6/tests/test_clipboard.c:42:53: style: Argument '(unsigned long)r' to function memcmp is always 12. It does not matter what value 'r' has. [knownArgument]\n xwpe-1.6.6/tests/test_clipboard.c:29:21: note: Assignment 'want=\"\\x1b]52;c;SGk=\\a\"', assigned value is \"\u001b]52;c;SGk=\\a\"\n xwpe-1.6.6/tests/test_clipboard.c:34:14: note: Assuming condition is false\n xwpe-1.6.6/tests/test_clipboard.c:40:8: note: Assuming condition is false\n xwpe-1.6.6/tests/test_clipboard.c:42:16: note: Assuming that condition '(unsigned long)r!=strlen(want)' is not redundant\n xwpe-1.6.6/tests/test_clipboard.c:42:53: note: Argument '(unsigned long)r' to function memcmp is always 12. It does not matter what value 'r' has." ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "Line 42 is the usual pattern: check `(size_t)r != strlen(want)`, then call `memcmp(buf, want, (size_t)r)`. The third argument is 12 only because the short-circuit condition guarantees `r == strlen(want)`. It is not 12 because some constant expression hides `r`. The message \"It does not matter what value 'r' has\" is therefore wrong, and there is nothing to fix in the code. The PR now treats a variable whose first value is an impossible int (here `r < 0` is impossible after line 40) as having no known value. That lets the check fire on values that come from conditions, which this check was never meant to cover. This is a new false positive." } } ], "started": "2026-10-28 13:10:01 UTC", "runner": "server" }