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.
ea4a25287eEvan Haas committed on 6/12/2021, 8:12:37 PM· committed by Veikka Tuominenparent44cdafd
7 files changedLine totals unavailable