diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-08 17:17:15 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-08 17:17:15 -0400 |
| commit | aeed1992e94c5ab6a5104a06a921101fbe8f40ed (patch) | |
| tree | 8ba6dc531acefa0eedd330224f16f750496e8dbe /repl.c | |
| parent | cf9d5b1619b9e5e886d2754f167046ff77d36abf (diff) | |
Fix nearly every GCC warning and add __attribute__((pure/const)) where
appropriate
Diffstat (limited to 'repl.c')
| -rw-r--r-- | repl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -73,7 +73,7 @@ void repl(void) printf("\n"); } -__attribute__((noreturn)) +__attribute__((noreturn, format(printf, 2, 3))) static void repl_err(ast_t *node, const char *fmt, ...) { bool color = isatty(STDERR_FILENO) && !getenv("NO_COLOR"); @@ -331,6 +331,7 @@ void run(env_t *env, ast_t *ast) } } +#pragma GCC diagnostic ignored "-Wstack-protector" void eval(env_t *env, ast_t *ast, void *dest) { type_t *t = get_type(env, ast); @@ -512,7 +513,7 @@ void eval(env_t *env, ast_t *ast, void *dest) char item_buf[item_size] = {}; for (ast_list_t *item = Match(ast, Array)->items; item; item = item->next) { eval(env, item->ast, item_buf); - Array$insert(&arr, item_buf, I(0), padded_type_size(Match(t, ArrayType)->item_type)); + Array$insert(&arr, item_buf, I(0), (int64_t)padded_type_size(Match(t, ArrayType)->item_type)); } memcpy(dest, &arr, sizeof(Array_t)); break; |
