<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/128831>128831</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
-Wshadow false negative for function parameter shadowing (partially; incorrectly) a global variable (incorrectly used as array length expression)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
false-negative
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alejandro-colomar
</td>
</tr>
</table>
<pre>
```c
alx@debian:~/tmp$ cat f.c
extern int n;
void f(int a[n], int n);
alx@debian:~/tmp$ gcc -Wall -Wextra -Wshadow -S f.c
alx@debian:~/tmp$ clang -Weverything -Wno-vla -S f.c
alx@debian:~/tmp$
```
That program obviously has a bug. The number of elements of 'a' is intended to be $2, but it is actually controlled by the global variable 'n'. I think -Wshadow should diagnose this.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMks-PuzYQxf8acxmBnAECOXBI-lWknrvSnsd4AG-NHdmGJpf-7ZWT3W4PbfWVkPj13oP3maEYzeyYB9FeRPujoC0tPgxk-YOcDr4cvfUrhUJ5_RjEUb6OUcgz2btopGZlyIn6_KfAa1pvAhsYKcFUZQ3fEwcHxiVwor4IeRbyvHujYRLY58ck2osT7Q-Bv3zK8PRS_nf-PI5QvpO1UL7zPQWC8j0upP0fUP6Wvwz__3uW3JytO4dHWszzxvlyt_RT_tziC8Sr0dtCCW7Bz4FW8Go3fov2AQtFIFDbXAG8LQxuWxUH8BOw5ZVdivlaYEcCOzAxA2CnWUPyoBgENpi5qC2BSVlAY9rI2geM3qXgrWUN6gFpYZitV2Rhp2BI2WzunMCuAvgVcsnfvyHFxW9WgzY0Ox85v45VoYdan-oTFTwcuka27aE7YbEMBzyqI3GrJcmeTrKRcjqoDk8dH7hlXZgBJbYS8SiP9bHGqqGxb-qpQaWo181RNJJXMraydl8rH-bCxLjxcMC-rw-FJcU2PjcQcSIbuXQ8UzI7C8S8lWHIzlJtcxSNtCam-J2VTLI8_F3uGQBfATD5ANPmxmS8gxsFWjlxgJc4j15gf6OQTMYq6gsYN_oQeEz2IfAE9C9g-39oYIusIQ86BHqAZTenBfh-Cxyj8Xmdiy3YYUnpFkV9FngVeJ1NWjZVjX4VeM1NPk_lLfgPHpPA6xNRFHj9pLQP-FcAAAD__9itL4E">