https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97548

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
The fix isn't very robust since it only handles redeclarations with VLA
parameters that involve bounds that have the same name but not nontrivial
expressions involving different names, like in this case:

$ cat pr97548-c6.c && gcc -S -Wall pr97548-c6.c
void g (int k, int [k + 1]);
void g (int m, int [m + 1]) { }   // bogus warning
pr97548-c6.c:2:16: warning: argument 2 of type ‘int[m + 1]’ declared with
mismatched bound ‘m + 1’ [-Wvla-parameter]
    2 | void g (int m, int [m + 1]) { }   // bogus warning
      |                ^~~~~~~~~~~
pr97548-c6.c:1:16: note: previously declared as ‘int[k + 1]’ with bound ‘k + 1’
    1 | void g (int k, int [k + 1]);
      |                ^~~~~~~~~~~

Reply via email to