Repository navigation
fix(sqlite-objstore): make hex-id buffer size a compile-time constant for MSVC - #24
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an MSVC C build failure in the embedded sqlite-objstore file backend by making the hex-ID buffer length a compile-time constant (avoiding MSVC treating a static const size_t as a non-constant and therefore producing a VLA error).
Changes:
- Replace
static const size_t kObjstoreIdHexCharswith a preprocessor constant sochar hex_id[kObjstoreIdHexChars + 1]is a true constant-sized stack array under MSVC C.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 3 of the Windows port for the npm release of @augmem/cortext v1.3.3
(follow-up to PR #22 dirent and PR #23 unistd/fcntl). After those, both
Windows matrix jobs failed with:
MSVC C does not treat a static const size_t as a compile-time constant, so
char hex_id[kObjstoreIdHexChars + 1] is a VLA. This turns kObjstoreIdHexChars
into a #define of OBJSTORE_ID_SIZE * 2 (already a preprocessor constant).
No other const-sized stack arrays exist in the embedded objstore sources.