summaryrefslogtreecommitdiff
path: root/cgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgen.c')
-rw-r--r--cgen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgen.c b/cgen.c
index b40870f..22b9fa7 100644
--- a/cgen.c
+++ b/cgen.c
@@ -1747,8 +1747,10 @@ static bool cgen_decl(CGenerator *g, Declaration *d) {
/* don't generate function pointer declaration for constant fns */
continue;
}
- if (!cgen_val_pre(g, *val, type, d->where))
- return false;
+ if (has_expr) {
+ if (!cgen_val_pre(g, *val, type, d->where))
+ return false;
+ }
if (g->block != NULL)
cgen_write(g, "static ");
if (!cgen_type_pre(g, type, d->where)) return false;