model-writtenrun 5944 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Greg Nancarrow reported MSVC C4101 warnings for htup and tolp in non-assert builds and submitted a patch placing their declarations inside assertion guards in #1; Daniel Gustafsson initially approved it in #2.
- Alvaro Herrera argued for fixing PG_USED_FOR_ASSERTS_ONLY across platforms in #3, and Tom Lane said correctly annotated code should remain intact while the compiler annotation was fixed or its warnings ignored in #4.
- Daniel suggested replacing pointer typedefs with explicit pointer declarations in #5, but Tom rejected the inconsistency and questioned whether the annotation worked anywhere under MSVC in #6.
- Daniel found that initializing the variables to NULL suppressed the warnings and attributed the difference to MSVC tolerating variables that were assigned but never read; he also submitted an independent cleanup of two incorrectly annotated variables in #7.
- The discussion explored [[maybe_unused]] and macro syntax changes in #8, #9, and #10, but Greg demonstrated that the attribute worked only in C++ mode with his MSVC installation in #11.
- Dagfinn Ilmari Mannsåker proposed attribute feature detection in #12, then acknowledged after Tom's response that Clang already advertised GCC compatibility in #13 and #14; no attribute-detection change was submitted.
- Daniel narrowed the immediate choices to Greg's declaration guards or disabling C4101 in #15; Greg preferred a local fix and opposed losing a useful warning, while explicitly endorsing the separate annotation cleanup in #16.
- Daniel advocated suppressing C4101 until a usable MSVC annotation existed in #18; Andrew Dunstan objected in #19, but Tom defended suppression and cross-platform warning detection in #20, and Daniel agreed to implement it in #21.
- Andrew identified Windows-only unused variables as the remaining risk and acknowledged that Msys GCC builds would likely detect them in #22.
- Daniel committed the annotation cleanup from #7 unchanged as ac0db34e0e and implemented the discussion's C4101 suppression in src/tools/msvc/Project.pm as e7122548a3.
- Daniel confirmed both changes were applied in #23, closing the immediate warning issue; Greg's original declaration-guard patch was superseded, while a portable MSVC implementation of PG_USED_FOR_ASSERTS_ONLY remained future work.