diff options
author | Martin Sebor <msebor@redhat.com> | 2020-05-18 15:24:12 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2020-05-18 15:24:12 -0600 |
commit | 7a41fcde6c67faafab8c8ee2a31140999383dcef (patch) | |
tree | 05c39a4f7d249ebd4878d1b392aa0ba747a96a85 /gcc/tree.h | |
parent | 3956244c58acceebf1ef2cf9a63e99f0f82abcb7 (diff) | |
download | gcc-7a41fcde6c67faafab8c8ee2a31140999383dcef.zip gcc-7a41fcde6c67faafab8c8ee2a31140999383dcef.tar.gz gcc-7a41fcde6c67faafab8c8ee2a31140999383dcef.tar.bz2 |
PR middle-end/92815 - spurious -Wstringop-overflow writing into a flexible array of an extern struct
gcc/ChangeLog:
PR middle-end/92815
* tree-object-size.c (decl_init_size): New function.
(addr_object_size): Call it.
* tree.h (last_field): Declare.
(first_field): Add attribute nonnull.
gcc/testsuite/ChangeLog:
PR middle-end/92815
* gcc.dg/Warray-bounds-56.c: Remove xfails.
* gcc.dg/builtin-object-size-20.c: New test.
* gcc.dg/builtin-object-size-21.c: New test.
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4700,9 +4700,10 @@ extern tree nreverse (tree); extern int list_length (const_tree); -/* Returns the first FIELD_DECL in a type. */ +/* Returns the first/last FIELD_DECL in a RECORD_TYPE. */ -extern tree first_field (const_tree); +extern tree first_field (const_tree) ATTRIBUTE_NONNULL (1); +extern tree last_field (const_tree) ATTRIBUTE_NONNULL (1); /* Given an initializer INIT, return TRUE if INIT is zero or some aggregate of zeros. Otherwise return FALSE. If NONZERO is not |