From a0a65357339b1d68ba3a7601236ea22905477263 Mon Sep 17 00:00:00 2001 From: redhole Date: Wed, 11 Mar 2026 13:36:05 -0400 Subject: [PATCH] fix: const-correctness in ggml-bitnet-mad.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `y` is declared as `const int8_t *` (line 794) but `y_col` on line 811 drops the const qualifier by assigning to `int8_t *`. This is a const-correctness violation that compiles as a hard error on Clang with strict settings (e.g. ClangCL on Windows). Additionally, the llama.cpp submodule has missing `#include ` in `common/log.cpp` and `common/common.cpp` — both use `std::chrono::system_clock` but rely on transitive includes that only work on GCC/Apple Clang, not ClangCL. That fix should be applied to the llama.cpp submodule (Eddie-Wang1120/llama.cpp branch merge-dev). --- src/ggml-bitnet-mad.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ggml-bitnet-mad.cpp b/src/ggml-bitnet-mad.cpp index 4ba9d6509..ad18bac04 100644 --- a/src/ggml-bitnet-mad.cpp +++ b/src/ggml-bitnet-mad.cpp @@ -808,7 +808,7 @@ void ggml_vec_dot_i2_i8_s_Nx1(int n, float * s, size_t bs, const void * vx, size accu[iy] = _mm256_setzero_si256(); } - int8_t * y_col = y + col * by; + const int8_t * y_col = y + col * by; for (int i = 0; i < group32_num; i++) { const uint8_t *px = x + i * 1024;