aboutsummaryrefslogtreecommitdiff
path: root/gcc/attribs.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2020-10-23 12:37:38 -0600
committerMartin Sebor <msebor@redhat.com>2020-10-23 12:37:38 -0600
commit757ba6653c2699761c2243e0194749a6695112d8 (patch)
tree9cbfe237f74cbb0fe21cf7631916f1273eb9e384 /gcc/attribs.c
parent7991e963239160624b22a12caaacce95d3667e49 (diff)
downloadgcc-757ba6653c2699761c2243e0194749a6695112d8.zip
gcc-757ba6653c2699761c2243e0194749a6695112d8.tar.gz
gcc-757ba6653c2699761c2243e0194749a6695112d8.tar.bz2
PR middle-end/97552 - missing waning passing null to a VLA argument declared [static]
gcc/ChangeLog: PR middle-end/97552 * attribs.c (init_attr_rdwr_indices): Handle static VLA parameters. gcc/c/ChangeLog: PR middle-end/97552 * c-decl.c (get_parm_array_spec): Handle static VLA parameters. gcc/testsuite/ChangeLog: PR middle-end/97552 * gcc.dg/Wvla-parameter-2.c: Adjust text of expected warning. * gcc.dg/Wnonnull-5.c: New test.
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r--gcc/attribs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 3bdb2ff..a6f6b70 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -2109,6 +2109,7 @@ init_attr_rdwr_indices (rdwr_map *rwm, tree attrs)
is followed by a comma and a dollar sign its bound is
on the list. Otherwise it's a VLA with an unspecified
bound. */
+ acc.static_p = p[-2] == 's';
acc.minsize = HOST_WIDE_INT_M1U;
}