KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
2.9k stars 816 forks source link

-Wshadow fixes #3517

Closed AnyOldName3 closed 4 months ago

AnyOldName3 commented 4 months ago

A revival of https://github.com/KhronosGroup/glslang/pull/3143, but not on Robert's VulkanSceneGraph-specific branch with extra CMake changes. I've applied the same approach of prefixing names as found in that PR for my extra commits, even though it's not my favourite approach stylistically for avoiding this problem. I don't know if it

Updated for the current state of the codebase so it'll apply cleanly.

I think I found a bug in SPIRV/GlslangToSpv.cpp, that would have been prevented had this warning been enabled, and it looks like Robert found an equivalent a year ago, too. It's in a separate commit, and someone should probably check it.

I've not actually enabled -Wshadow for the project, and that might be something that's wanted.