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

            Bug ID: 118044
           Summary: -Wvla-parameter: False positive with [[gnu::access(wo,
                    n)]]
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alx at kernel dot org
  Target Milestone: ---

alx@devuan:~/tmp/gcc$ cat f.c
[[gnu::access(write_only, 2)]]
int f(int n, int a[n]);
int f(int n, int a[n]);
alx@devuan:~/tmp/gcc$ cc -Wall -Wno-attributes -S f.c 
f.c:3:18: warning: argument 2 of type ‘int[n]’ declared as a variable length
array [-Wvla-parameter]
    3 | int f(int n, int a[n]);
      |              ~~~~^~~~
f.c:2:18: note: previously declared as an ordinary array ‘int[]’
    2 | int f(int n, int a[n]);
      |              ~~~~^~~~

Reply via email to