mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-17 21:21:04 +00:00
Merge branch 'master' into bill/rexcode
This commit is contained in:
@@ -10179,6 +10179,10 @@ gb_internal ExprKind check_or_branch_expr(CheckerContext *c, Operand *o, Ast *no
|
||||
}
|
||||
}
|
||||
|
||||
if (c->in_defer) {
|
||||
error(node, "'%.*s' cannot be used within a 'defer'", LIT(name));
|
||||
}
|
||||
|
||||
return Expr_Expr;
|
||||
}
|
||||
|
||||
|
||||
@@ -791,7 +791,10 @@ gb_internal void check_scope_usage_internal(Checker *c, Scope *scope, u64 vet_fl
|
||||
array_add(&vetted_entities, ve_unused);
|
||||
} else if (is_shadowed) {
|
||||
array_add(&vetted_entities, ve_shadowed);
|
||||
} else if (e->kind == Entity_Variable && (e->flags & (EntityFlag_Param|EntityFlag_Using|EntityFlag_Static|EntityFlag_Field)) == 0 && !e->Variable.is_global) {
|
||||
} else if (e->kind == Entity_Variable &&
|
||||
((e->flags & (EntityFlag_Param|EntityFlag_Using|EntityFlag_Static|EntityFlag_Field)) == 0 ||
|
||||
(e->flags & EntityFlag_Result) != 0) &&
|
||||
!e->Variable.is_global) {
|
||||
i64 sz = type_size_of(e->type);
|
||||
// TODO(bill): When is a good size warn?
|
||||
// Is >256 KiB good enough?
|
||||
|
||||
@@ -3842,6 +3842,10 @@ int main(int arg_count, char const **arg_ptr) {
|
||||
usage(args[0]);
|
||||
return 1;
|
||||
}
|
||||
// NOTE(Jeroen): `odin root` omits a newline on purpose so that it can be used in scripts.
|
||||
// e.g. `ODIN_CORE="$(odin root)core"`.
|
||||
// Human convenience is not a consideration.
|
||||
// Further pull requests to add a newline will be closed without comment.
|
||||
gb_printf("%.*s", LIT(odin_root_dir()));
|
||||
return 0;
|
||||
} else if (command == "clear-cache") {
|
||||
|
||||
Reference in New Issue
Block a user