Build Error: cannot initialize a variable of type 'int8_t *' with an rvalue of type 'const int8_t

Open Beginner friendly
#463 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp
Domain
build-system

Research direction

Start at src/ggml-bitnet-mad.cpp around line 811 and reproduce the reported build with the project’s Windows or Debian configuration. Check the const-qualified pointer initialization and verify that the build completes with the relevant compiler; done means the reported compilation error is resolved without introducing new diagnostics.

Written by the indexing model from the issue text.

Description

On Windows and Debian, I had compilation problems along this line:

https://github.com/microsoft/BitNet/blob/01eb415772c342d9f20dc42772f1583ae1e5b102/src/ggml-bitnet-mad.cpp#L811

Error:

error: cannot initialize a variable of type 'int8_t *' with an rvalue of type 'const int8_t *'
int8_t * y_col = y + col * by;

So after adding a const to that variable, the build works perfectly.

Relevant informations:

===== SYSTEM =====
Linux debian 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64 GNU/Linux

===== OS =====
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"

===== CLANG =====
/usr/bin/clang
Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-20/bin

===== LLVM =====
/usr/bin/llvm-config-20
20.1.8

===== CMAKE =====
/usr/bin/cmake
cmake version 3.25.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

===== PYTHON =====
/home/user/Documentos/Codigos/bitnet/venv/bin/python3
Python 3.11.2

===== GCC (compat libs) =====
gcc (Debian 12.2.0-14+deb12u1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ (Debian 12.2.0-14+deb12u1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

===== CLANG VERBOSE =====
Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-20/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

Dominant language
C++
Stars
40.3k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/BitNet

All issues in microsoft/BitNet

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.