Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#463 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
cpp
领域
build-system

调研方向

从 src/ggml-bitnet-mad.cpp 大约第 811 行开始,使用项目的 Windows 或 Debian 配置复现报告中的构建。检查 const 限定指针的初始化,并验证使用相关编译器可以完成构建;完成的标准是解决报告中的编译错误,且不引入新的诊断信息。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
C++
星标
40.3k
派生
3.7k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/BitNet 的其他 Issue

查看 microsoft/BitNet 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。