summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-12 01:50:25 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-12 01:50:25 +0000
commit7c25ed5ca1c8553f0ee949f7621b7ae855b42a4d (patch)
tree358bb81ef767f30425a46ea86e3b13a89ce2dec9 /gcc/c
parent74a4140fabf2cbfc7adfb545468e07a427243690 (diff)
downloadgcc-7c25ed5ca1c8553f0ee949f7621b7ae855b42a4d.tar.gz
Fix incomplete initialization of the declspec struct.
* c-decl.c (build_null_declspecs): Zero the entire struct. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233367 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog2
-rw-r--r--gcc/c/c-decl.c28
2 files changed, 3 insertions, 27 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index dda2216abb9..0f3e7560056 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,7 @@
2016-02-12 Bernd Schmidt <bschmidt@redhat.com>
+ * c-decl.c (build_null_declspecs): Zero the entire struct.
+
PR c/69522
* c-parser.c (c_parser_braced_init): New arg outer_obstack. All
callers changed. If nested_p is true, use it to call
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 5f6f3ee2ad7..8e332f8c061 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -9460,38 +9460,12 @@ struct c_declspecs *
build_null_declspecs (void)
{
struct c_declspecs *ret = XOBNEW (&parser_obstack, struct c_declspecs);
- memset (&ret->locations, 0, cdw_number_of_elements);
- ret->type = 0;
- ret->expr = 0;
- ret->decl_attr = 0;
- ret->attrs = 0;
+ memset (ret, 0, sizeof *ret);
ret->align_log = -1;
ret->typespec_word = cts_none;
ret->storage_class = csc_none;
ret->expr_const_operands = true;
- ret->declspecs_seen_p = false;
ret->typespec_kind = ctsk_none;
- ret->non_sc_seen_p = false;
- ret->typedef_p = false;
- ret->explicit_signed_p = false;
- ret->deprecated_p = false;
- ret->default_int_p = false;
- ret->long_p = false;
- ret->long_long_p = false;
- ret->short_p = false;
- ret->signed_p = false;
- ret->unsigned_p = false;
- ret->complex_p = false;
- ret->inline_p = false;
- ret->noreturn_p = false;
- ret->thread_p = false;
- ret->thread_gnu_p = false;
- ret->const_p = false;
- ret->volatile_p = false;
- ret->atomic_p = false;
- ret->restrict_p = false;
- ret->saturating_p = false;
- ret->alignas_p = false;
ret->address_space = ADDR_SPACE_GENERIC;
return ret;
}