Skip to content

Fix const correctness bug in ggml-bitnet-mad.cpp (line 811)#516

Closed
wrenevens wants to merge 1 commit intomicrosoft:mainfrom
wrenevens:fix-const-correctness-bug
Closed

Fix const correctness bug in ggml-bitnet-mad.cpp (line 811)#516
wrenevens wants to merge 1 commit intomicrosoft:mainfrom
wrenevens:fix-const-correctness-bug

Conversation

@wrenevens
Copy link
Copy Markdown

The compiler errors because a non-const pointer (int8_t*) was being
assigned from a const pointer (const int8_t*).

Fix: add const to the pointer declaration on line 811.

Before: int8_t * y_col = y + col * by;
After: const int8_t * y_col = y + col * by;

The error's log:

/content/BitNet/src/ggml-bitnet-mad.cpp:811:18: error: cannot initialize a variable of type 'int8_t *' (aka 'signed char *') with an rvalue of type 'const int8_t *' (aka 'const signed char *')

  811 |         int8_t * y_col = y + col * by;

      |                  ^       ~~~~~~~~~~~~

@wrenevens
Copy link
Copy Markdown
Author

There are many duplicates, so I will close this pr!

@wrenevens wrenevens closed this Mar 30, 2026
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.

2 participants