You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler often cannot see through the tangle of code to make
100% correct deduction about whether a variable is initialized or
not. It usually errs on the side of caution and emits a warning.
One example is in codegen.cpp:emit_function where the variable SP
is only ever used when at the same time ctx.debug_enabled is set
to true. The compiler (at least gcc 5.x) doesn't keep track of
this relationship.
From my experience this kind of problem often appears in large
code bases which is why I'm kind of surprised I couldn't find a
framework to handle them. This is why I'm proposing the following
change.
Instead of adding one kludgy workaround here a macro JL_MARK_INITIALIZED
is introduced. When correctly defined (as I do it for gcc) this macro
creates no additional cost in the generated code while preventing the
warning. Definitions for other compilers should be added appropriately.
0 commit comments