public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101605] New: bogus -Wvla-parameter in same bound expression with differently named parameters
@ 2021-07-23 19:53 msebor at gcc dot gnu.org
  2022-08-16 15:14 ` [Bug c/101605] " msebor at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-23 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101605
           Summary: bogus -Wvla-parameter in same bound expression with
                    differently named parameters
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Even with pr97548 and pr 101585 resolved there are a few outstanding
-Wvla-parameter false positives as the test case below shows:

$ (set -x && cat u.c && gcc -S -Wall u.c && gcc -S -Wall -fsanitize=undefined
u.c)
+ cat u.c
void f (int m, int (*)[m]);
void f (int n, int (*)[n]) { }   // bogus warning with -fsanitize=undefined

void g (int m, int (*)[m + 1]);
void g (int n, int (*)[n + 1]) { }   // bogus warning either way

+ gcc -S -Wall u.c
u.c:5:16: warning: mismatch in bound 1 of argument 2 declared as ‘int (*)[n +
1]’ [-Wvla-parameter]
    5 | void g (int n, int (*)[n + 1]) { }   // bogus warning either way
      |                ^~~~~~~~~~~~~~
u.c:4:16: note: previously declared as ‘int (*)[m + 1]’
    4 | void g (int m, int (*)[m + 1]);
      |                ^~~~~~~~~~~~~~
+ gcc -S -Wall -fsanitize=undefined u.c
u.c:2:16: warning: mismatch in bound 1 of argument 2 declared as ‘int (*)[(long
int)(n) - 1]’ [-Wvla-parameter]
    2 | void f (int n, int (*)[n]) { }   // bogus warning with
-fsanitize=undefined
      |                ^~~~~~~~~~
u.c:1:16: note: previously declared as ‘int (*)[(long int)(m) - 1]’
    1 | void f (int m, int (*)[m]);
      |                ^~~~~~~~~~
u.c:5:16: warning: mismatch in bound 1 of argument 2 declared as ‘int (*)[(long
int)(n + 1) - 1]’ [-Wvla-parameter]
    5 | void g (int n, int (*)[n + 1]) { }   // bogus warning either way
      |                ^~~~~~~~~~~~~~
u.c:4:16: note: previously declared as ‘int (*)[(long int)(m + 1) - 1]’
    4 | void g (int m, int (*)[m + 1]);
      |                ^~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/101605] bogus -Wvla-parameter in same bound expression with differently named parameters
  2021-07-23 19:53 [Bug c/101605] New: bogus -Wvla-parameter in same bound expression with differently named parameters msebor at gcc dot gnu.org
@ 2022-08-16 15:14 ` msebor at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: msebor at gcc dot gnu.org @ 2022-08-16 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-07-23 00:00:00         |2022-08-16
      Known to fail|                            |11.1.0, 12.1.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with GCC 11 and 12.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-16 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-23 19:53 [Bug c/101605] New: bogus -Wvla-parameter in same bound expression with differently named parameters msebor at gcc dot gnu.org
2022-08-16 15:14 ` [Bug c/101605] " msebor at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).