{ "tokens": { "input": 105324, "cache_read": 116064, "cache_write": 4836, "output": 14767 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/a/altos/altos_1.9.22.orig.tar.gz", "main altos-1.9.22/src/aes/ao_aes.c:287:49: style: Argument 'rkk' shadows outer variable [shadowVariable]\n altos-1.9.22/src/aes/ao_aes.c:363:17: note: Shadowed variable\n altos-1.9.22/src/aes/ao_aes.c:287:49: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function argument 'rkk' at line 287 is declared before the global variable 'rkk' at line 363. In C, the later global is not in scope inside xrijndaelEncrypt, so nothing is actually shadowed. The PR now skips global variables declared after the shadowing variable, so this false positive is removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/android-framework-23/android-framework-23_6.0.1+r72.orig.tar.xz", "main frameworks/base/core/jni/core_jni_helpers.h:69:63: style: Argument 'gMethods' shadows outer variable [shadowVariable]\n frameworks/base/core/jni/android_media_AudioTrack.cpp:1055:24: note: Shadowed variable\n frameworks/base/core/jni/core_jni_helpers.h:69:63: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "RegisterMethodsOrDie is defined in core_jni_helpers.h, which android_media_AudioTrack.cpp includes near the top. The global array 'gMethods' is declared later, at line 1055 of the .cpp file. When the parameter is declared, that global does not yet exist, so nothing is shadowed. Main compared only line numbers across different files (69 < 1055) and wrongly treated the global as visible. The PR compares token order instead, so the global is correctly seen as declared after the parameter. This removes a false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/anjuta/anjuta_3.34.0.orig.tar.xz", "main anjuta-3.34.0/plugins/language-support-js/util.c:32:10: style: Local variable 'plugin' shadows outer variable [shadowVariable]\n anjuta-3.34.0/plugins/language-support-js/util.c:82:10: note: Shadowed variable\n anjuta-3.34.0/plugins/language-support-js/util.c:32:10: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'plugin' at line 32 was reported as shadowing a variable declared at line 82. That variable is a file-scope variable declared after get_gjs_path(), so it is not visible at line 32 and nothing is shadowed. The PR now skips global variables declared after the local one, which removes this false positive (same case as the new #15114 test)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/audacity/audacity_4.0.1+dfsg.orig.tar.xz", "main audacity-4.0.1/au3/libraries/au3-menus/MenuRegistry.h:78:39: style: Argument 'key' shadows outer variable [shadowVariable]\n audacity-4.0.1/au3/libraries/au3-menus/CommandManager.cpp:105:66: note: Shadowed variable\n audacity-4.0.1/au3/libraries/au3-menus/MenuRegistry.h:78:39: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The 'shadowed' variable is a global 'key' declared at CommandManager.cpp:105, after MenuRegistry.h has been included. The argument 'key' in the inline member function at header line 78 comes earlier in the translation unit. At that point the global is not yet declared, so nothing is shadowed. The PR now skips global-scope variables that are declared after the shadowing variable, so this false positive is correctly removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/a/audacity/audacity_4.0.1+dfsg.orig.tar.xz", "main audacity-4.0.1/src/au3cloud/internal/au3cloudprojectfileioextension.cpp:51:40: style: Local variable 'extension' shadows outer variable [shadowVariable]\n audacity-4.0.1/src/au3cloud/internal/au3cloudprojectfileioextension.cpp:55:43: note: Shadowed variable\n audacity-4.0.1/src/au3cloud/internal/au3cloudprojectfileioextension.cpp:51:40: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local static 'extension' is declared on line 51, inside GetExtension(). The global 'extension' is declared later, on line 55. At line 51 the global is not yet visible, so nothing is shadowed and the old warning was a false positive. The PR now skips global variables declared after the local one, which removes this false positive. This matches the new test case for #15114." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/b/bristol/bristol_0.60.11.orig.tar.gz", "main bristol-0.60.11/libbristolmidi/midiFileMgt.c:641:17: style: Local variable 'tv' shadows outer variable [shadowVariable]\n bristol-0.60.11/libbristolmidi/midiFileMgt.c:787:23: note: Shadowed variable\n bristol-0.60.11/libbristolmidi/midiFileMgt.c:641:17: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'tv' at line 641 is declared inside logthread(). The supposedly shadowed 'tv' is a global declared later, at line 787. A global declared after the function is not visible inside it, so nothing is shadowed and the warning was a false positive. The PR now skips global variables that come after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/d/dibbler/dibbler_1.0.1.orig.tar.gz", "main dibbler-1.0.1/Port-linux/daemon.cpp:125:11: style: Local variable 'pid' shadows outer variable [shadowVariable]\n dibbler-1.0.1/Port-linux/daemon.cpp:207:14: note: Shadowed variable\n dibbler-1.0.1/Port-linux/daemon.cpp:125:11: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local `pid` at line 125 is declared inside `init()`. The supposedly shadowed `pid` is at line 207, after this function. Since the warning disappeared under the new global-scope ordering check, that declaration must be at global scope. A global declared later in the file is not visible at line 125, so nothing is shadowed. Removing this false positive is correct and matches the PR's intent (#15114)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/d/djview4/djview4_4.12.3.orig.tar.xz", "main djview4-4.12.3/nsdejavu/nsdejavu.c:2035:31: style: Argument 'npclass' shadows outer variable [shadowVariable]\n djview4-4.12.3/nsdejavu/nsdejavu.c:2245:16: note: Shadowed variable\n djview4-4.12.3/nsdejavu/nsdejavu.c:2035:31: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function argument 'npclass' at line 2035 was reported as shadowing a global variable declared later, at line 2245. In C, a global declared after the function is not in scope inside it, so nothing is shadowed and the warning was a false positive. The PR now skips global variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/d/dpf-plugins/dpf-plugins_1.7+ds1.orig.tar.xz", "main DPF-Plugins-1.7/plugins/ProM/projectM/src/museum/projectM-xmms/sdltoprojectM.h:28:38: style: Argument 'event' shadows outer variable [shadowVariable]\n DPF-Plugins-1.7/plugins/ProM/projectM/src/museum/projectM-xmms/main.cpp:99:11: note: Shadowed variable\n DPF-Plugins-1.7/plugins/ProM/projectM/src/museum/projectM-xmms/sdltoprojectM.h:28:38: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The parameter 'event' of sdl2pmEvent() in sdltoprojectM.h was reported as shadowing a variable at main.cpp:99. That variable can only be a global, because a local in another function cannot be shadowed. The header is included near the top of main.cpp, so the global 'event' is declared after this function. At the point of the parameter it is not yet visible, so nothing is shadowed. The old code never applied any declaration-order check to global-scope variables. The PR now compares token order for global scope too, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fflas-ffpack/fflas-ffpack_2.5.0.orig.tar.gz", "main fflas-ffpack-2.5.0/benchmarks/benchmark-fgemv-mp.C:58:73: style: Argument 'm' shadows outer variable [shadowVariable]\n fflas-ffpack-2.5.0/benchmarks/benchmark-fgemv-mp.C:88:15: note: Shadowed variable\n fflas-ffpack-2.5.0/benchmarks/benchmark-fgemv-mp.C:58:73: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The argument 'm' of write_matrix is declared at line 58. The global static 'm' is declared later, at line 88, so it is not visible inside write_matrix and nothing is shadowed. Main reported this because it only skipped later declarations in executable scopes. The PR also skips later declarations in the global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/firebird3.0/firebird3.0_3.0.14.ds7.orig.tar.xz", "main Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:332:20: style: Local variable 't' shadows outer variable [shadowVariable]\n Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:642:9: note: Shadowed variable\n Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:332:20: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local iterator 't' at line 332 is reported as shadowing a variable 't' declared at line 642, which is later in the file. That variable is in a non-executable outer scope, which given this PR's change must be the global scope. A global declared after the function is not visible at line 332, so nothing is shadowed and the warning was a false positive. The PR now skips global variables declared after the local one (#15114), which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/firebird3.0/firebird3.0_3.0.14.ds7.orig.tar.xz", "main Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:372:29: style: Local variable 't' shadows outer variable [shadowVariable]\n Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:642:9: note: Shadowed variable\n Firebird-3.0.14.33856-0/src/common/classes/misc/string_test.cpp:372:29: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 't' at line 372 is declared inside a function body. The supposedly shadowed 't' is at line 642, after it. That later variable is likely a global or one in an enclosing non-executable scope. A variable declared later in the file cannot be shadowed by an earlier local. Main only skipped later declarations in executable scopes. The PR now also skips later declarations in the global scope, so this false positive is removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/gdcm/gdcm_3.0.24.orig.tar.xz", "main gdcm-3.0.24/Applications/Cxx/gdcmxml.cxx:58:64: style: Argument 'ts' shadows outer variable [shadowVariable]\n gdcm-3.0.24/Applications/Cxx/gdcmxml.cxx:80:16: note: Shadowed variable\n gdcm-3.0.24/Applications/Cxx/gdcmxml.cxx:58:64: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function argument 'ts' at line 58 belongs to a member function defined inline in a class. The global 'TransferSyntax ts' is declared later, at line 80. When the class is parsed, that global is not yet declared, so the argument shadows nothing. The PR now skips global-scope variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/g/glvis/glvis_4.5.orig.tar.gz", "main glvis-4.5/lib/aux_vis.hpp:163:6: style: Local variable 'input' shadows outer variable [shadowVariable]\n glvis-4.5/glvis.cpp:66:5: note: Shadowed variable\n glvis-4.5/lib/aux_vis.hpp:163:6: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The template function `prompt` in aux_vis.hpp declares a local `input`. The global `input` at glvis.cpp:66 is declared after that header is included, so it is not in scope at that point and nothing is shadowed. The old check compared only line numbers across different files (66 < 163), which produced this false positive. The new check uses token order, so it correctly skips a global declared later." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/i/ivykis/ivykis_0.43.2.orig.tar.gz", "main ivykis-0.43.2/test/avl.c:38:15: style: Local variable 'f' shadows outer variable [shadowVariable]\n ivykis-0.43.2/test/avl.c:139:21: note: Shadowed variable\n ivykis-0.43.2/test/avl.c:38:15: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'f' at line 38 is in tree_node_print, whose only enclosing scope is the global scope. So the 'shadowed' variable at line 139 must be a global declared about 100 lines later. A global declared after the function is not visible at line 38, so nothing is shadowed. The PR now skips global-scope variables declared after the local one, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/k/kinput2/kinput2_3.1.orig.tar.gz", "main kinput2-v3.1/lib/dispatch.c:139:13: style: Local variable 'data' shadows outer variable [shadowVariable]\n kinput2-v3.1/lib/dispatch.c:166:11: note: Shadowed variable\n kinput2-v3.1/lib/dispatch.c:139:13: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "This is K&R-style C. The \"shadowed variable\" at line 166 is the parameter 'data' of the later function MyAddEventHandler. The local 'data' at line 139 belongs to MyDispatchEvent, a separate function defined earlier, so nothing is shadowed. Main produced the false positive because of its line-number comparison with K&R parameter declarations. The PR uses token order instead, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/lbzip2/lbzip2_2.5.orig.tar.bz2", "main lbzip2-2.5/src/main.c:162:15: style: Local variable 'suffix' shadows outer variable [shadowVariable]\n lbzip2-2.5/src/main.c:639:28: note: Shadowed variable\n lbzip2-2.5/src/main.c:162:15: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'suffix' is declared at line 162 inside xstrtol(). The 'shadowed' variable is at line 639, and since main reported it as an outer variable, it is a file-scope (global) declaration. It comes after xstrtol(), so it is not visible at line 162 and cannot be shadowed there. Main only skipped later declarations in executable scopes. The PR also skips later declarations in the global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/lifelines/lifelines_3.0.61.orig.tar.gz", "main lifelines-3.0.61/src/gedlib/nodeio.c:131:6: style: Local variable 'lev' shadows outer variable [shadowVariable]\n lifelines-3.0.61/src/gedlib/nodeio.c:255:12: note: Shadowed variable\n lifelines-3.0.61/src/gedlib/nodeio.c:131:6: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'lev' at line 131 is reported as shadowing a 'lev' declared at line 255. That later declaration is file-scope (likely 'static INT lev'). Another function's local would not be in the enclosing scope chain that findShadowed searches. In C, a global declared after the function is not visible inside it, so nothing is shadowed. The PR now skips global-scope variables declared after the shadowing variable. Removing this warning removes a false positive, the same case as the PR's #15114 test." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/lsof/lsof_4.99.4+dfsg.orig.tar.xz", "main lsof-4.99.4/tests/LTlib.c:721:7: style: Argument 'pn' shadows outer variable [shadowVariable]\n lsof-4.99.4/tests/LTlib.c:767:7: note: Shadowed variable\n lsof-4.99.4/tests/LTlib.c:721:7: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The argument 'pn' of PrtMsg (line 721) was reported as shadowing a global 'pn' declared at line 767, which comes after the function. A global declared later is not visible inside PrtMsg, so nothing is shadowed and the warning was a false positive. The PR now skips global variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/l/lucene++/lucene++_3.0.9.orig.tar.gz", "main LucenePlusPlus-rel_3.0.9/src/core/search/PhraseScorer.cpp:118:16: style: Local variable '__pp' shadows outer variable [shadowVariable]\n LucenePlusPlus-rel_3.0.9/src/core/search/PhraseScorer.cpp:118:40: note: Shadowed variable\n LucenePlusPlus-rel_3.0.9/src/core/search/PhraseScorer.cpp:118:16: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "Line 118 declares a single loop variable `__pp`. The 'shadowed' token at column 40 is the same variable being used later in the loop condition and step on that line, likely in a confusing tokenization of `__pp = __pp->__next`. No outer variable named `__pp` exists in an enclosing scope. The `__pp` in pqToList is declared later in a sibling function. Main compared only line numbers, so a declaration later on the same line was not skipped. The PR uses token order via `succeeds`, which skips it and removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/liba/libapache2-mod-lisp/libapache2-mod-lisp_1.3.1.orig.tar.gz", "main libapache2-mod-lisp-1.3.1.orig/mod_lisp.c:272:38: style: Argument 'local_cfg' shadows outer variable [shadowVariable]\n libapache2-mod-lisp-1.3.1.orig/mod_lisp.c:307:13: note: Shadowed variable\n libapache2-mod-lisp-1.3.1.orig/mod_lisp.c:272:38: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function parameter 'local_cfg' at line 272 is declared before the global 'local_cfg' at line 307. At line 272 the global does not exist yet, so the parameter does not shadow anything. The old code only skipped later declarations inside executable scopes. The PR also skips later declarations in the global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/libr/libreswan/libreswan_5.2.orig.tar.gz", "main libreswan-5.2/programs/cavp/test_ikev2.c:31:16: style: Argument 'ni' shadows outer variable [shadowVariable]\n libreswan-5.2/programs/cavp/test_ikev2.c:126:16: note: Shadowed variable\n libreswan-5.2/programs/cavp/test_ikev2.c:31:16: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function parameter 'ni' is on line 31. The global variable 'ni' is declared later, at line 126. In C a declaration that comes later in the file is not visible at line 31, so nothing is shadowed and the warning was a false positive. Main only skipped later declarations in executable scopes. The PR also skips them in the global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/magics++/magics++_4.17.0.orig.tar.gz", "main magics-4.17.0/src/decoders/GribDecoder.cc:1675:12: style: Local variable 'proj' shadows outer variable [shadowVariable]\n magics-4.17.0/src/decoders/GribDecoder.cc:2642:64: note: Shadowed variable\n magics-4.17.0/src/decoders/GribDecoder.cc:1675:12: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local `string proj` in `GribDecoder::representation()` is at line 1675. The supposedly shadowed variable is declared much later, at line 2642, in an outer (global/namespace) scope. A variable declared later in the file is not visible at line 1675, so nothing is shadowed. The PR now skips global-scope variables declared after the shadowing variable (the #15114 fix), which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/magics++/magics++_4.17.0.orig.tar.gz", "main magics-4.17.0/src/decoders/ThinningMethod.cc:47:44: style: Argument 'data' shadows outer variable [shadowVariable]\n magics-4.17.0/src/decoders/ThinningMethod.cc:92:63: note: Shadowed variable\n magics-4.17.0/src/decoders/ThinningMethod.cc:47:44: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "The reported 'shadowed' variable is declared at line 92, after the operator() definition at line 47, in the same .cc file. It is most likely a later global-scope declaration rather than a class member (members would normally live in the header). A global declared later is not visible at line 47, so the parameter 'data' cannot shadow it. The PR now skips later declarations in global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/magics++/magics++_4.17.0.orig.tar.gz", "main magics-4.17.0/src/decoders/ThinningMethod.cc:59:48: style: Argument 'data' shadows outer variable [shadowVariable]\n magics-4.17.0/src/decoders/ThinningMethod.cc:92:63: note: Shadowed variable\n magics-4.17.0/src/decoders/ThinningMethod.cc:59:48: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The global 'data' object is declared at line 92, after the operator() definition at line 59. At the point of the argument declaration that global is not in scope, so the argument shadows nothing. The PR now skips global-scope variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mangohud/mangohud_0.8.4+dfsg.orig.tar.xz", "main MangoHud-v0.8.4/src/overlay.h:106:9: style: Local variable 'params' shadows outer variable [shadowVariable]\n MangoHud-v0.8.4/src/app/main.cpp:38:16: note: Shadowed variable\n MangoHud-v0.8.4/src/overlay.h:106:9: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "overlay.h is included by main.cpp, and main.cpp declares its global 'params' at line 38, after that include. The old code compared line numbers across different files, so it treated the later global as declared earlier and reported shadowing. A local variable cannot shadow a global that is declared later in the translation unit, so the warning was a false positive. The PR uses token order instead, which removes it." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mangohud/mangohud_0.8.4+dfsg.orig.tar.xz", "main MangoHud-v0.8.4/src/overlay.h:106:9: style: Local variable 'params' shadows outer variable [shadowVariable]\n MangoHud-v0.8.4/src/win/d3d_shared.h:6:30: note: Shadowed variable\n MangoHud-v0.8.4/src/overlay.h:106:9: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local `params` in the inline function `engine_name()` in overlay.h (line 106) was reported as shadowing a global declared at d3d_shared.h:6. That header almost certainly includes overlay.h first, so its global comes after `engine_name()` in the translation unit. A global declared later is not in scope inside the earlier function body, so nothing is shadowed and the warning was a false positive. Main flagged it only because it compared line numbers across different files (6 < 106). The PR compares token order instead, which correctly removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mangohud/mangohud_0.8.4+dfsg.orig.tar.xz", "main MangoHud-v0.8.4/src/overlay.h:95:55: style: Argument 'sw_stats' shadows outer variable [shadowVariable]\n MangoHud-v0.8.4/src/app/main.cpp:37:17: note: Shadowed variable\n MangoHud-v0.8.4/src/overlay.h:95:55: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function `engine_name(const swapchain_stats& sw_stats)` is defined inline in overlay.h. main.cpp includes that header near the top and only later, at line 37, declares a global `sw_stats`. So at the point where the parameter is declared, the global does not exist yet, and the parameter cannot shadow it. The old check compared line numbers across different files: 37 < 95, so it wrongly treated the global as declared earlier. The PR compares token order with `succeeds()` and now correctly skips this later global. A false positive was removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mangohud/mangohud_0.8.4+dfsg.orig.tar.xz", "main MangoHud-v0.8.4/src/overlay.h:95:55: style: Argument 'sw_stats' shadows outer variable [shadowVariable]\n MangoHud-v0.8.4/src/win/d3d_shared.h:7:31: note: Shadowed variable\n MangoHud-v0.8.4/src/overlay.h:95:55: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The parameter `sw_stats` in `engine_name()` (overlay.h:95) was reported as shadowing the global `sw_stats` declared in d3d_shared.h:7. d3d_shared.h most likely includes overlay.h before that declaration, so the global comes later in the token stream. At the point of the inline function, that global is not in scope and nothing is shadowed. The old check compared line numbers only inside executable scopes and never skipped later globals. The PR now skips global variables that come after the shadowing variable in token order, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/navit/navit_0.5.6+dfsg.1.orig.tar.xz", "main navit-0.5.6/navit/popup.c:72:26: style: Local variable 'c' shadows outer variable [shadowVariable]\n navit-0.5.6/navit/popup.c:375:22: note: Shadowed variable\n navit-0.5.6/navit/popup.c:72:26: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local 'c' at popup.c:72 is reported as shadowing a variable declared later at line 375. That variable is probably a global declared after this function. A variable declared later cannot be shadowed, so the main warning is a false positive. The old check only skipped later variables in executable scopes; the PR now also skips them in the global scope. Removing this warning is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nestopia/nestopia_2.0.0+dfsg.orig.tar.xz", "main nestopia-2.0.0-27246144887c78154584515f530c61497e92cd05/nes_ntsc/demo_impl.h:149:58: style: Argument 'palette' shadows outer variable [shadowVariable]\n nestopia-2.0.0-27246144887c78154584515f530c61497e92cd05/nes_ntsc/demo.c:20:18: note: Shadowed variable\n nestopia-2.0.0-27246144887c78154584515f530c61497e92cd05/nes_ntsc/demo_impl.h:149:58: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The shadowed global `palette` is at demo.c:20:18, which matches `static SDL_Color palette [256];`. In nes_ntsc's demo.c that declaration comes after `#include \"demo_impl.h\"`. In token order, `load_bmp`'s parameter `palette` is therefore declared before the global exists, so nothing is shadowed at that point. The old check compared only line numbers across files: line 149 in the header against line 20 in demo.c. That wrongly treated the later global as an earlier declaration. The PR compares token order instead (`succeeds`) and now skips globals declared later, as in #15114. Removing this false positive is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/netdata/netdata_1.37.1.orig.tar.xz", "main netdata-1.37.1/libnetdata/storage_number/storage_number.h:125:27: style: Local variable 'unpack_storage_number_lut10x' shadows outer variable [shadowVariable]\n netdata-1.37.1/libnetdata/storage_number/storage_number.c:90:16: note: Shadowed variable\n netdata-1.37.1/libnetdata/storage_number/storage_number.h:125:27: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function is in storage_number.h, which is included near the top of storage_number.c. The global `unpack_storage_number_lut10x` is defined later, at line 90 of the .c file. When the header is processed, that global does not exist yet, so nothing is being shadowed. Also, the local `extern NETDATA_DOUBLE unpack_storage_number_lut10x[...]` only declares that same global variable; it is not a separate variable that hides it. The PR now skips global variables that appear later in token order, so this false positive is correctly removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/netpipes/netpipes_4.2.orig.tar.gz", "main netpipes-4.2.orig/encapsulate.c:1313:10: style: Argument 'sockfd' shadows outer variable [shadowVariable]\n netpipes-4.2.orig/encapsulate.c:1469:12: note: Shadowed variable\n netpipes-4.2.orig/encapsulate.c:1313:10: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "The parameter 'sockfd' at line 1313 was reported as shadowing a variable declared at line 1469, after spawn_child(). Shadow lookup from a function goes to the enclosing (global) scope, so the line-1469 'sockfd' must be a file-scope variable. A file-scope variable declared later is not visible at line 1313, so nothing is shadowed there. The PR now skips global variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nfs-ganesha/nfs-ganesha_9.14.orig.tar.gz", "main nfs-ganesha-9.14/src/support/nfs_ip_name.c:124:17: style: Local variable 'nfs_ip_name' shadows outer variable [shadowVariable]\n nfs-ganesha-9.14/src/support/nfs_ip_name.c:429:21: note: Shadowed variable\n nfs-ganesha-9.14/src/support/nfs_ip_name.c:124:17: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "The reported 'shadowed' variable is declared at line 429, well after the local `nfs_ip_name` at line 124. It can only be reached through the scope chain if it is at file scope, and the PR only changes the filtering for global and executable scopes. A file-scope variable declared after line 124 is not yet visible inside `display_ip_name_val`, so the local does not actually shadow it. The PR now skips global variables declared after the shadowing variable, which removes this false positive. This matches the new #15114 test case." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/notify-osd/notify-osd_0.9.35+20.04.20191129.orig.tar.gz", "main tests/test-withlib.c:134:20: style: Local variable 'loop' shadows outer variable [shadowVariable]\n tests/test-withlib.c:189:19: note: Shadowed variable\n tests/test-withlib.c:134:20: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The shadowed 'loop' is a file-scope variable declared at line 189, after the function with the local 'loop' at line 134. A global declared later in the file is not in scope at line 134, so nothing is shadowed. The old code skipped the declaration-order check for the global scope. The PR now applies it to globals too, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/n/nsd/nsd_4.15.4.orig.tar.gz", "main nsd-4.15.4/namedb.h:344:75: style: Argument 'buf' shadows outer variable [shadowVariable]\n nsd-4.15.4/nsd-checkconf.c:136:13: note: Shadowed variable\n nsd-4.15.4/namedb.h:344:75: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The parameter 'buf' of domain_to_string_buf in namedb.h is said to shadow a global 'buf' declared at nsd-checkconf.c:136. namedb.h is included near the top of nsd-checkconf.c, so this function comes before that global in the translation unit. The global is not visible inside the function, so nothing is shadowed. Main compared line numbers across files and skipped the position check for global scope. The PR uses token order and also applies it to the global scope, so this false positive is now gone." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/olm/olm_3.2.16+dfsg.orig.tar.xz", "main olm-3.2.16/lib/curve25519-donna/test-curve25519.c:15:61: style: Argument 'k' shadows outer variable [shadowVariable]\n olm-3.2.16/lib/curve25519-donna/test-curve25519.c:31:15: note: Shadowed variable\n olm-3.2.16/lib/curve25519-donna/test-curve25519.c:15:61: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The parameter 'k' of doit() is declared on line 15. The global 'k' is declared later, on line 31. At the point of doit's definition the global is not yet visible, so nothing is shadowed. The PR now skips later declarations in global scope too, which removes this false positive. This matches the new test case #15114." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/o/onednn/onednn_3.12.1+ds.orig.tar.xz", "main uxlfoundation-oneDNN-c8c37fd/tests/benchdnn/dnn_types.hpp:576:29: style: Argument 'hints' shadows outer variable [shadowVariable]\n uxlfoundation-oneDNN-c8c37fd/tests/benchdnn/dnnl_common.hpp:96:20: note: Shadowed variable\n uxlfoundation-oneDNN-c8c37fd/tests/benchdnn/dnn_types.hpp:576:29: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The `hints` parameter of the `isa_hints_t` constructor in dnn_types.hpp is reported as shadowing a variable declared at dnnl_common.hpp:96. dnnl_common.hpp very likely includes dnn_types.hpp, so that global `hints` is declared later in the translation unit. At line 576 the global is not visible yet, so nothing is shadowed. The old check compared bare line numbers across different files (96 < 576) and ignored declaration order for global scope. The PR uses token order and also applies it to global scope, which correctly removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/papyrus/papyrus_3.7.1+dfsg.orig.tar.xz", "main Papyrus3/PapyMemSystem.cpp:300:43: style: Argument 'aPapyMemSystem' shadows outer variable [shadowVariable]\n Papyrus3/PapyMemSystem.cpp:305:16: note: Shadowed variable\n Papyrus3/PapyMemSystem.cpp:300:43: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The function argument 'aPapyMemSystem' at line 300 comes before the global variable of the same name, which is declared at line 305. At the point of the function definition the global is not yet visible, so the argument does not shadow anything. The PR now skips global-scope variables declared after the shadowing variable, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/r/radare2/radare2_6.1.8+ds.orig.tar.xz", "main radare2-6.1.8+ds/libr/arch/include/disas-asm.h:380:33: style: Argument 'options' shadows outer variable [shadowVariable]\n radare2-6.1.8+ds/libr/arch/p/s390_gnu/s390-dis.c:40:29: note: Shadowed variable\n radare2-6.1.8+ds/libr/arch/include/disas-asm.h:380:33: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The parameter `options` belongs to the static inline function `next_disassembler_option` in disas-asm.h. The 'shadowed' variable is a file-scope `options` at s390-dis.c:40. That file presumably includes disas-asm.h near its top, so in token order the function is defined before the global is declared. A parameter cannot shadow a global that does not exist yet at that point. Main only skipped later declarations in executable scopes, and it compared line numbers across different files. The PR uses token order and also applies it to the global scope, so this false positive is correctly removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/r/rox/rox_2.11.orig.tar.gz", "main rox-2.11/ROX-Filer/src/pinboard.c:1070:25: style: Local variable 'parent_class' shadows outer variable [shadowVariable]\n rox-2.11/ROX-Filer/src/pinboard.c:2091:17: note: Shadowed variable\n rox-2.11/ROX-Filer/src/pinboard.c:1070:25: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local static 'parent_class' at line 1070 is reported as shadowing a variable declared at line 2091. Line 2091 comes after line 1070, so that declaration is not yet in scope at line 1070. In C, a file-scope variable declared later cannot be shadowed by an earlier local. The old code only skipped later declarations inside executable scopes. The PR also skips them in the global scope, matching the new test for #15114. Removing this false positive is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/ser2net/ser2net_4.6.8.orig.tar.gz", "main ser2net-4.6.8/tests/sertest.c:354:38: style: Argument 'c' shadows outer variable [shadowVariable]\n ser2net-4.6.8/tests/sertest.c:632:25: note: Shadowed variable\n ser2net-4.6.8/tests/sertest.c:354:38: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The argument 'c' of write_gensio is at line 354. The variable it was reported as shadowing is the global at line 632, which is declared after this function. At line 354 that global is not yet in scope, so nothing is shadowed and the warning was a false positive. The PR now skips global variables declared after the shadowing variable, which removes it." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/starpu/starpu_1.4.10+dfsg.orig.tar.gz", "main starpu-1.4.10+dfsg/mpi/examples/matrix_mult/mm_2dbc.c:125:92: style: Argument 'tag' shadows outer variable [shadowVariable]\n starpu-1.4.10+dfsg/mpi/examples/matrix_mult/mm_2dbc.c:151:18: note: Shadowed variable\n starpu-1.4.10+dfsg/mpi/examples/matrix_mult/mm_2dbc.c:125:92: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The global 'tag' is declared at line 151, after register_matrix (line 125). When the parameter 'tag' is declared, no outer 'tag' is in scope, so nothing is shadowed. The old code skipped later declarations only in executable scopes, not the global scope. The PR now also skips later declarations in the global scope, which removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/t/tcl9.1/tcl9.1_9.1.0+dfsg.orig.tar.xz", "main tcl9.1.0/generic/tclClock.c:444:17: style: Local variable 'tz' shadows outer variable [shadowVariable]\n tcl9.1.0/generic/tclClock.c:4724:22: note: Shadowed variable\n tcl9.1.0/generic/tclClock.c:444:17: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The local `tz` in NormTimezoneObj (line ~449) was flagged as shadowing a `tz` declared at line 4724, far below this function. A global declared later in the file is not visible here, so nothing is shadowed and the warning was a false positive. The PR now skips global-scope declarations that come after the variable, which removes it (the same case as #15114 in the PR's test)." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.q.orig.tar.gz", "main tcp_wrappers_7.6/hosts_access.c:93:22: style: Argument 'request' shadows outer variable [shadowVariable]\n tcp_wrappers_7.6/hosts_access.c:187:22: note: Shadowed variable\n tcp_wrappers_7.6/hosts_access.c:93:22: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The removed warning says parameter 'request' at line 93 shadows a variable declared at line 187. That 'request' is almost certainly another K&R-style function's parameter, which Cppcheck seemed to treat as global. Either way, it is declared about 94 lines after hosts_access(). A declaration that comes later in the file cannot be shadowed by an earlier one. The PR now skips global-scope variables declared after the shadowing variable, so this false positive goes away." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/t/tightvnc/tightvnc_1.3.10.orig.tar.gz", "main vnc_unixsrc/Xvnc/lib/font/Type1/spaces.c:448:29: style: Argument 'cy' shadows outer variable [shadowVariable]\n vnc_unixsrc/Xvnc/lib/font/Type1/spaces.c:546:27: note: Shadowed variable\n vnc_unixsrc/Xvnc/lib/font/Type1/spaces.c:448:29: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The K&R-style parameter 'cy' of IXYboth() is declared at line 448. The supposedly shadowed 'cy' is at line 546, which is later in the file. In C, a file-scope name declared after a function is not visible inside it, so nothing is shadowed. The old code skipped the 'declared later' check for non-executable (global) scopes. The PR now also applies it to global scope, so this false positive is removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/v4l-utils/v4l-utils_1.32.0.orig.tar.xz", "main v4l-utils-1.32.0/contrib/test/v4l2gl.c:80:40: style: Argument 'x_res' shadows outer variable [shadowVariable]\n v4l-utils-1.32.0/contrib/test/v4l2gl.c:284:12: note: Shadowed variable\n v4l-utils-1.32.0/contrib/test/v4l2gl.c:80:40: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The argument 'x_res' of capture() is at line 80. The global variable 'x_res' is declared at line 284, after the function. A global that is declared later is not visible inside capture(), so nothing is shadowed and the old warning was a false positive. The PR now skips global-scope variables that come after the shadowing variable, which removes this warning correctly." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vdt/vdt_0.4.6.orig.tar.gz", "main vdt-0.4.6/src/expfWrapper.c:43:28: style: Argument 'data' shadows outer variable [shadowVariable]\n vdt-0.4.6/src/expfWrapper.c:63:14: note: Shadowed variable\n vdt-0.4.6/src/expfWrapper.c:43:28: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The global 'data' is declared at line 63, after the function vdt_vd (line 43). At the argument's location the global is not yet in scope, so nothing is shadowed and the warning was a false positive. The PR now skips global variables declared after the shadowing variable, which removes it." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/v/vte2.91/vte2.91_0.84.1.orig.tar.xz", "main vte-0.84.1/src/parser.hh:1167:26: style: Argument 'parser' shadows outer variable [shadowVariable]\n vte-0.84.1/src/parser-test.cc:47:8: note: Shadowed variable\n vte-0.84.1/src/parser.hh:1167:26: note: Shadow argument" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "The reported shadowed variable is the global `parser` at parser-test.cc:47. That declaration comes after `#include \"parser.hh\"`, so in token order it follows the constructor argument `Sequence(Parser& parser)` at parser.hh:1167. A global declared later is not visible inside the constructor, so the argument does not shadow it. Main compared only line numbers across different files (1167 > 47). The PR compares token order, which also applies to global scope, so this false positive is now removed." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/y/yasr/yasr_0.6.9.orig.tar.gz", "main yasr-0.6.9/yasr/gettext.h:197:8: style: Local variable 'buf' shadows outer variable [shadowVariable]\n yasr-0.6.9/yasr/yasr.h:209:22: note: Shadowed variable\n yasr-0.6.9/yasr/gettext.h:197:8: note: Shadow local variable" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "The local `buf` in `dcpgettext_expr` (gettext.h:197) was reported as shadowing a global `buf` declared at yasr.h:209. Main skipped later declarations only in executable scopes, and only by comparing line numbers, so it never skipped later globals. The PR also skips global-scope variables that come after the local in token order. The warning disappearing means the global `buf` comes after this inline function in the translation unit, which fits gettext.h being included near the top of yasr.h. A variable declared later cannot be shadowed by an earlier local (same situation as the #15114 test). Removing this warning removes a false positive." } } ], "started": "2026-10-20 14:15:56 UTC", "runner": "pc" }