Commit 686eb58
committed
enum declaration for StrKind, ExprKind
Reduce header include, but violate `pedantic`.
CIで失敗:
```
cc -ansi -std=c11 -pedantic -MMD -Wall -Wextra -Werror -Wold-style-definition -Wno-missing-field-initializers -Wno-empty-body -D_DEFAULT_SOURCE -O2 -g3 -Isrc/util -DXCC_TARGET_ARCH=XCC_ARCH_X64 -Isrc/cc/frontend -c -o obj/initializer.o src/cc/frontend/initializer.c
In file included from src/cc/frontend/expr.c:2:
src/cc/frontend/expr.h:22:68: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
22 | Expr *string_expr(const Token *token, char *str, ssize_t len, enum StrKind kind);
| ^~~~~~~
src/cc/frontend/expr.h:32:29: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
32 | Expr *new_expr_num_bop(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rhs);
| ^~~~~~~~
src/cc/frontend/expr.h:33:29: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
33 | Expr *new_expr_int_bop(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rhs);
| ^~~~~~~~
src/cc/frontend/expr.h:34:28: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
34 | Expr *new_expr_addsub(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rhs);
| ^~~~~~~~
src/cc/frontend/expr.h:41:22: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
41 | Expr *incdec_of(enum ExprKind kind, Expr *target, const Token *tok);
| ^~~~~~~~
src/cc/frontend/expr.h:42:25: error: ISO C forbids forward references to ‘enum’ types [-Werror=pedantic]
42 | Expr *new_expr_cmp(enum ExprKind kind, const Token *tok, Expr *lhs, Expr *rhs);
| ^~~~~~~~
```1 parent 1c3c225 commit 686eb58
3 files changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
4 | 21 | | |
5 | 22 | | |
6 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
| |||
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
159 | | - | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
0 commit comments