aboutsummaryrefslogtreecommitdiff
path: root/decl.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-02-15 12:45:29 -0800
committerMichael Forney <mforney@mforney.org>2019-02-15 12:45:29 -0800
commit848325a5b189a9e5e30a16a268909cd4037343ce (patch)
tree87df12f0c6fb35d1053dcaf6304e346c4ab16eb7 /decl.c
parentb84e6efa47ef670dffaf05ee29e77ab52eee07b0 (diff)
Initialize align variable in declspecs
This matches how it is done for storage class and function specifier.
Diffstat (limited to 'decl.c')
-rw-r--r--decl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/decl.c b/decl.c
index 60f3970..5ef5f1b 100644
--- a/decl.c
+++ b/decl.c
@@ -243,6 +243,8 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspecifier *fs, int *a
*sc = SCNONE;
if (fs)
*fs = FUNCNONE;
+ if (align)
+ *align = 0;
for (;;) {
if (typequal(&tq) || storageclass(sc) || funcspec(fs))
continue;
@@ -628,7 +630,7 @@ structdecl(struct scope *s, struct type *t)
{
struct type *base;
struct member *m;
- int basealign = 0, align;
+ int basealign, align;
base = declspecs(s, NULL, NULL, &basealign);
if (!base)
@@ -701,7 +703,7 @@ decl(struct scope *s, struct function *f)
enum declarationkind kind;
enum linkage linkage;
uint64_t c;
- int align = 0;
+ int align;
if (consume(T_STATIC_ASSERT)) {
expect(TLPAREN, "after _Static_assert");