aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2016-02-12 01:50:25 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2016-02-12 01:50:25 +0000
commitf48dfe985e5405fed95b1a128e3e7b115dffc8f0 (patch)
tree358bb81ef767f30425a46ea86e3b13a89ce2dec9 /gcc/c/c-decl.c
parent16595a1f286b9f421000a25866f465bd45a24538 (diff)
downloadgcc-f48dfe985e5405fed95b1a128e3e7b115dffc8f0.zip
gcc-f48dfe985e5405fed95b1a128e3e7b115dffc8f0.tar.gz
gcc-f48dfe985e5405fed95b1a128e3e7b115dffc8f0.tar.bz2
Fix incomplete initialization of the declspec struct.
* c-decl.c (build_null_declspecs): Zero the entire struct. From-SVN: r233367
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 5f6f3ee..8e332f8 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;
}