diff options
| author | gingerBill <bill@gingerbill.org> | 2024-04-11 15:57:13 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-04-11 15:57:13 +0100 |
| commit | 503964c7699125e2388762780f7121a704e6e25a (patch) | |
| tree | 3ca733815ad7d291e1758c77a93ac7f83d6e1d4b /src/checker.cpp | |
| parent | b2e887be36a23dbfc52e50eb054ccceeeea31692 (diff) | |
Add @(static) check
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 900a4f243..0d72c1e76 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -703,13 +703,13 @@ gb_internal void check_scope_usage(Checker *c, Scope *scope, u64 vet_flags) { 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)) == 0 && !e->Variable.is_global) { + } else if (e->kind == Entity_Variable && (e->flags & (EntityFlag_Param|EntityFlag_Using|EntityFlag_Static)) == 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? if (sz > 1ll<<18) { gbString type_str = type_to_string(e->type); - warning(e->token, "Declaration of '%.*s' may cause a stack overflow due to its type '%s' having a size of %lld bytes", LIT(e->token.string), type_str, cast(long long)sz); + warning(e->token, "Declaration of '%.*s' may cause a stack overflow? due to its type '%s' having a size of %lld bytes", LIT(e->token.string), type_str, cast(long long)sz); gb_string_free(type_str); } } |