diff options
| author | Evan Haas <evan@lagerdata.com> | 2021-06-08 17:09:42 -0700 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-06-12 23:12:37 +0300 |
| commit | ea4a25287eb65e639fd75d425f320663e6e8dca1 (patch) | |
| tree | b207a5d47fc1b3b42bca6ad8aa10b2283779255c /lib/std/event/loop.zig | |
| parent | 44cdafd9d46bed36f08effb99aa0bb7fc2145efa (diff) | |
| download | zig-ea4a25287eb65e639fd75d425f320663e6e8dca1.tar.gz zig-ea4a25287eb65e639fd75d425f320663e6e8dca1.zip | |
translate-c: better support for static local variables
Don't move static local variables into the top-level scope since this
can cause name clashes if subsequently-defined variables or parameters
in different scopes share the name.
Instead, use a variable within a struct so that the variable's lexical
scope does not change. This solution was suggested by @LemonBoy
Note that a similar name-shadowing problem exists with `extern` variables
declared within block scope, but a different solution will be needed since
they do need to be moved to the top-level scope and we can't rename them.
Diffstat (limited to 'lib/std/event/loop.zig')
0 files changed, 0 insertions, 0 deletions
