Skip to content

Commit 8137220

Browse files
committed
lx: Suppress warning for possibly unused function.
These may or may not be called, depending on the input.
1 parent 002b5a5 commit 8137220

File tree

1 file changed

+10
-0
lines changed
  • src/lx/print

1 file changed

+10
-0
lines changed

src/lx/print/c.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,16 @@ lx_print_c(FILE *f, const struct ast *ast, const struct fsm_options *opt)
11531153
fprintf(f, "\tlx->end.line = 1;\n");
11541154
fprintf(f, "\tlx->end.col = 1;\n");
11551155
}
1156+
1157+
/* Suppress warning for possibly unused function */
1158+
if (~api_exclude & API_BUF) {
1159+
if (api_tokbuf & API_FIXEDBUF) {
1160+
fprintf(f, "\t(void)%sfixedpop;\n", prefix.api);
1161+
} else if (api_tokbuf & API_DYNBUF) {
1162+
fprintf(f, "\t(void)%sdynpop;\n", prefix.api);
1163+
}
1164+
}
1165+
11561166
fprintf(f, "}\n");
11571167
fprintf(f, "\n");
11581168
}

0 commit comments

Comments
 (0)