fix(warnings): silence two -Wall/-Wextra warnings on the MinGW build#350
Merged
Conversation
A clean 'make glm' on MinGW emitted exactly two warnings, both real: 1. compat.h:240 - ignoring pragma comment [-Wunknown-pragmas] #pragma comment(lib, "psapi.lib") is an MSVC directive; MinGW/GCC warns about it. Guarded with ifdef _MSC_VER - MinGW links psapi via -lpsapi (already in the Makefile), MSVC keeps the pragma. 2. glm.c:1210 - g_numa_nodes defined but not used [-Wunused-variable] g_numa_nodes is only read/written inside ifdef __linux__ blocks, so on every non-Linux build it is a static that is never used. Moved the definition under the same __linux__ guard; nothing references it off-Linux. Verified: rm -f *.o glm.exe && make glm -> 0 warnings, 0 errors.
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.
What
A clean
make glmon MinGW emitted exactly two-Wall -Wextrawarnings. Both are real; this silences them.The two warnings
1.
compat.h:240—ignoring '#pragma comment ' [-Wunknown-pragmas]#pragma comment(lib, "psapi.lib")This is an MSVC linker directive. MinGW/GCC doesn't understand it and warns. Guarded with
#ifdef _MSC_VER— MinGW already links psapi via-lpsapi(in the Makefile /.build-config), and MSVC keeps the pragma.2.
glm.c:1210—'g_numa_nodes' defined but not used [-Wunused-variable]g_numa_nodesis only read/written inside#ifdef __linux__blocks (numa_slab_bind,numa_init). On every non-Linux build it's a file-scope static that nothing references → unused-variable warning. Moved the definition under the same__linux__guard:Off-Linux
numa_slab_bind/numa_initare already full no-ops (they(void)their args and return), so nothing references the variable there.Verification
Behavior is unchanged on Linux (the variable is identical there) and on MSVC (the pragma is unchanged there).