Adding minor fix for when DEBUG_COMMENTS is enabled.#146
Conversation
There was a problem hiding this comment.
Code Review
This pull request modifies CAPE/Debugger.c to declare the instruction variable unconditionally. The review feedback correctly points out that this change will cause an unused variable warning or compilation error on x86 builds where _WIN64 is not defined, and suggests conditionally declaring the variable only when needed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| _DecodedInst instruction; | ||
| #ifdef _WIN64 |
There was a problem hiding this comment.
Declaring instruction unconditionally will lead to an unused variable warning (or error if warnings are treated as errors) on x86 builds when DEBUG_COMMENTS is disabled, because instruction is only used when _WIN64 is defined or when DEBUG_COMMENTS is enabled. Conditionally declaring it only when needed avoids this issue.
#if defined(_WIN64) || defined(DEBUG_COMMENTS)
_DecodedInst instruction;
#endif
#ifdef _WIN64
This fixes a case where
instructionis uninitialized whenDEBUG_COMMENTSis enabled and the build target is not_WIN64:Moving the
_DecodedInst instructiondeclaration before the#ifdef _WIN64fixes this case.