Make the GCC deprecation-message check actually test the GCC version - #355
Open
Chang-Jin-Lee wants to merge 1 commit into
Open
Chang-Jin-Lee wants to merge 1 commit into
Chang-Jin-Lee wants to merge 1 commit into
Conversation
GCC_VERSION is not a predefined macro, so `#if GCC_VERSION >= 40500` compared 0 against 40500 and always took the branch below it. Every deprecated symbol in the public header therefore lost its message on GCC: warning: 'spvReflectGetShaderModule' is deprecated [-Wdeprecated-declarations] instead of warning: 'spvReflectGetShaderModule' is deprecated: renamed to spvReflectCreateShaderModule [-Wdeprecated-declarations] `-Wundef` reports it directly: "GCC_VERSION is not defined, evaluates to 0". Spelled the version comparison out rather than defining GCC_VERSION, because this is a public header and that name is common enough in other projects to collide. Fixes KhronosGroup#336 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
|
spencer-lunarg
approved these changes
Sep 14, 2026
Contributor
|
@Chang-Jin-Lee can you make sure the CLA is signed for this repo so I can merge this (if you did, try https://cla-assistant.io/ to retrigger it) |
Author
|
Sorry for the slow reply. The CLA is mine to clear and it is still unsigned — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #336.
GCC_VERSIONis not predefined by GCC, so#if GCC_VERSION >= 40500has always compared 0 against 40500 and taken the branch below it. Every deprecated symbol in the public header loses its message on GCC:and with this change it reads
-Wundefnames the cause on its own:"GCC_VERSION" is not defined, evaluates to 0, atspirv_reflect.h:49. Clang and MSVC were never affected, since they are handled by the branches above.The issue suggests defining
GCC_VERSION. I spelled the comparison out instead — this is a public header, andGCC_VERSIONis a common enough spelling in other projects that defining it here could collide with a consumer's own. The>= 40500gate is left alone rather than dropped, so the intent of the original code is unchanged.Checked on GCC 13.3.0: the message appears in C and in C++ under
-Wall -Wextra, the-Wundefwarning is gone, andtest-spirv-reflectis 3678 passing. The edit sits inside the file'sclang-format offregion, so the formatting job has nothing to reflow.🤖 Generated with Claude Code