Skip to content

Comments

fix: resolve const-correctness error in ggml-bitnet-mad.cpp#409

Open
eon-ic wants to merge 1 commit intomicrosoft:mainfrom
eon-ic:main
Open

fix: resolve const-correctness error in ggml-bitnet-mad.cpp#409
eon-ic wants to merge 1 commit intomicrosoft:mainfrom
eon-ic:main

Conversation

@eon-ic
Copy link

@eon-ic eon-ic commented Feb 4, 2026

Fixes the following build error:
ggml-bitnet-mad.cpp:811:17: error: cannot initialize a variable of type 'int8_t *' with an rvalue of type 'const int8_t *'

Changed int8_t *y_col to const int8_t *y_col to respect const correctness, as y is a const input pointer and its data should not be modified.

@EdwardLarson
Copy link

+1

I had the same issue and this fixed it. @tsong-ms PTAL 🙏

}

int8_t * y_col = y + col * by;
const int8_t * y_col = y + col * by;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following worked for me:

Suggested change
const int8_t * y_col = y + col * by;
int8_t * y_col = (int8_t *)(y + col * by);

But yours also should work off course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants