diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-10-29 23:14:31 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-10-29 23:14:31 -0400 |
| commit | 9ebb039a81f5ea06e97d84ef7ee447da9dfca204 (patch) | |
| tree | dc229247feb19ddec117e3c680dd1c13a40dbdd1 /typecheck.c | |
| parent | 3e019df9f429caef4b05947cc70652634ebb2467 (diff) | |
Fix up some GCC compiler flag options for LTO and inlining
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/typecheck.c b/typecheck.c index 6cc41216..9818ad33 100644 --- a/typecheck.c +++ b/typecheck.c @@ -20,6 +20,7 @@ type_t *parse_type_ast(env_t *env, type_ast_t *ast) { +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" switch (ast->tag) { case VarTypeAST: { @@ -121,6 +122,7 @@ type_t *parse_type_ast(env_t *env, type_ast_t *ast) } case UnknownTypeAST: code_err(ast, "I don't know how to get this type"); } +#pragma GCC diagnostic pop errx(1, "Unreachable"); } @@ -478,6 +480,8 @@ type_t *get_clause_type(env_t *env, type_t *subject_t, when_clause_t *clause) type_t *get_type(env_t *env, ast_t *ast) { if (!ast) return NULL; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch-default" switch (ast->tag) { case Null: { type_t *t = parse_type_ast(env, Match(ast, Null)->type); @@ -1244,6 +1248,7 @@ type_t *get_type(env_t *env, ast_t *ast) case DateTime: return Type(DateTimeType); case Unknown: code_err(ast, "I can't figure out the type of: %W", ast); } +#pragma GCC diagnostic pop code_err(ast, "I can't figure out the type of: %W", ast); } @@ -1328,11 +1333,13 @@ PUREFUNC bool is_constant(env_t *env, ast_t *ast) case TextLiteral: { CORD literal = Match(ast, TextLiteral)->cord; CORD_pos i; +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-conversion" CORD_FOR(i, literal) { if (!isascii(CORD_pos_fetch(i))) return false; // Non-ASCII requires grapheme logic, not constant } +#pragma GCC diagnostic pop return true; // Literal ASCII string, OK } case Not: return is_constant(env, Match(ast, Not)->value); |
