public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/101585] New: Bad interaction of -fsanitize=undefined and -Wvla-parameters
@ 2021-07-22 22:18 jahns at dkrz dot de
  2021-07-23  0:01 ` [Bug c/101585] [11/12 Regression] " msebor at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jahns at dkrz dot de @ 2021-07-22 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101585
           Summary: Bad interaction of -fsanitize=undefined and
                    -Wvla-parameters
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jahns at dkrz dot de
  Target Milestone: ---

The following source causes an incorrect warning with gcc 11.1.0 (sorry did not
have 11.1.1 available, it's not yet in spack):

void a(long send_size_asize, int (*)[send_size_asize]);
void a(long send_size_asize, int (*)[send_size_asize]) {}

Compiling it with

gcc-11.1 -c -Wall -Werror -fsanitize=undefined mini.c

results in

mini.c:2:30: error: mismatch in bound 1 of argument 2 declared as 'int
(*)[(send_size_asize) - 1]'
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wvla-parameter-Werror=vla-parameter]8;;]
    2 | void a(long send_size_asize, int (*)[send_size_asize]) {}
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
mini.c:1:30: note: previously declared as 'int (*)[(send_size_asize) - 1]'
    1 | void a(long send_size_asize, int (*)[send_size_asize]);
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

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

end of thread, other threads:[~2022-04-07 10:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 22:18 [Bug c/101585] New: Bad interaction of -fsanitize=undefined and -Wvla-parameters jahns at dkrz dot de
2021-07-23  0:01 ` [Bug c/101585] [11/12 Regression] " msebor at gcc dot gnu.org
2021-07-23  0:02 ` msebor at gcc dot gnu.org
2021-07-27 19:52 ` cvs-commit at gcc dot gnu.org
2021-07-27 20:33 ` [Bug c/101585] [11 " msebor at gcc dot gnu.org
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2022-04-07 10:40 ` cvs-commit at gcc dot gnu.org
2022-04-07 10:40 ` rguenth 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).