diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-11 15:55:08 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-01-11 15:55:08 -0500 |
commit | 97a03066a174facb1e6944263f30a4c3a877d882 (patch) | |
tree | 061cf95e614cf4535682ded3a88133a82794de2f | |
parent | d59df2fad1031728b2b0004327f73f46c3beb56a (diff) |
fixed clang warning
-rw-r--r-- | eval.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -994,9 +994,16 @@ static Value val_alloc(Allocator *a, Type *t) { case TYPE_ARR: val.arr = allocr_calloc(a, t->arr.n, compiler_sizeof(t->arr.of)); break; +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wsometimes-uninitialized" +#endif default: break; } return val; +#ifdef __clang__ +#pragma clang diagnostic pop +#endif } static bool val_is_nonnegative(Value *v, Type *t) { @@ -1517,8 +1524,8 @@ static bool eval_expr(Evaluator *ev, Expression *e, Value *v) { err_print(e->where, "Slice index out of bounds (to = %lu, length = %lu).", (unsigned long)to, (unsigned long)n); return false; } - void *ptr1, *ptr2; if (from < to) { + void *ptr1 = NULL, *ptr2 = NULL; if (!eval_val_ptr_at_index(e->where, &ofv, from, of_type, &ptr1, NULL)) return false; if (!eval_val_ptr_at_index(e->where, &ofv, to, of_type, &ptr2, NULL)) |