aboutsummaryrefslogtreecommitdiff
path: root/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'decl.c')
-rw-r--r--decl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/decl.c b/decl.c
index 94e4b15..0c3b037 100644
--- a/decl.c
+++ b/decl.c
@@ -379,9 +379,10 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspec *fs, int *align)
*align = other->align;
} else {
i = intconstexpr(s, false);
- if (!i || i & (i - 1) || i > 16)
+ if (i & (i - 1) || i > 16)
error(&tok.loc, "invalid alignment: %d", i);
- *align = (int)i;
+ if (i)
+ *align = (int)i;
}
expect(TRPAREN, "to close '_Alignas' specifier");
break;