Skip to content

Fix clang warning in gguf_check_reserved_keys #12686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

yeahdongcn
Copy link
Collaborator

Make sure to read the contributing guidelines before submitting a PR

We recently enabled our in-house CI for MUSA backend, and this warning was detected in a fresh build:

[  0%] Building CXX object ggml/src/CMakeFiles/ggml-base.dir/gguf.cpp.o
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = unsigned char; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:944:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
  930 | static void gguf_check_reserved_keys(const std::string & key, const T val) {
      |                                                               ~~~~~~~~^~~
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = signed char; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:950:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:956:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = short int; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:962:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = int; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:974:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = float; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:980:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = long unsigned int; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:986:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = long int; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:992:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = double; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:998:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = bool; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:1004:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = const char*; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:1010:38:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = const void*; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:1016:39:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp: In instantiation of ‘void gguf_check_reserved_keys(const string&, T) [with T = const char**; std::string = std::__cxx11::basic_string<char>]’:
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:1029:39:   required from here
/home/xiaodongye/ws/ggml/llama.cpp/ggml/src/gguf.cpp:930:71: warning: parameter ‘val’ set but not used [-Wunused-but-set-parameter]

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Apr 1, 2025
@yeahdongcn yeahdongcn force-pushed the xd/gguf_check_reserved_keys branch from c35339a to 69f6166 Compare April 1, 2025 08:15
@JohannesGaessler JohannesGaessler merged commit a6f32f0 into ggml-org:master Apr 1, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants