Repository navigation
Conversation
…CORE
Compiled with -DSQLITE_CORE, as when sqlite-vec.c is built into SQLite or
an application, sqlite3_vec_init(), sqlite3_vec_numpy_init() and
sqlite3_vec_static_blobs_init() never read their pApi parameter, since
SQLITE_EXTENSION_INIT2() is its only use and SQLITE_CORE leaves it out. With
-Wall -Wextra each of them warns:
gcc -Ivendor -Wall -Wextra -DSQLITE_CORE -DSQLITE_VEC_STATIC \
-c sqlite-vec.c -o vec.o
sqlite-vec.c:12525:65: warning: unused parameter 'pApi'
sqlite-vec.c:12610:71: warning: unused parameter 'pApi'
sqlite-vec.c:12629:59: warning: unused parameter 'pApi'
Each now marks it with UNUSED_PARAMETER() in that case, as two of them do
for pzErrMsg. The command prints no warning with gcc 14.2 or clang 19.1, and
the loadable extension, built without SQLITE_CORE, is unchanged.
This was referenced Oct 23, 2026
mceachen
added a commit
that referenced
this pull request
Oct 24, 2026
#9's entry said -DSQLITE_CORE builds compile without warnings, but gcc -O3 still reports eight -Wmaybe-uninitialized warnings.
Member
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.
Compiled with
-DSQLITE_CORE, as whensqlite-vec.cis built into SQLite or into an application,sqlite3_vec_init(),sqlite3_vec_numpy_init()andsqlite3_vec_static_blobs_init()never read theirpApiparameter:SQLITE_EXTENSION_INIT2()is its only use, andSQLITE_COREleaves it out. A project that compiles the file into its own binary with-Wall -Wextragets three warnings from main, with gcc 14.2 and with clang 19.1:(gcc's source excerpts under each warning are trimmed.) The Makefile's
statictarget compiles without-Wall -Wextra, so the project's own builds do not print them.Each function now marks
pApiwithUNUSED_PARAMETER()in theSQLITE_COREcase, assqlite3_vec_numpy_init()andsqlite3_vec_static_blobs_init()already do forpzErrMsg. The commit adds a### Fixedentry under[Unreleased]in CHANGELOG.md, at the head of the list, where it merges cleanly with main at a791836 and with #4, #7, #8, #11 and #12.Test. The command above prints the three warnings on main and none on this branch, with either compiler.
UNUSED_PARAMETER()is a(void)cast, so the object files are byte-identical before and after, both for the loadable extension and with-DSQLITE_CORE.make test-loadable(449 passed, 3 skipped) andmake test-unitpass.The same change is open on vlasky/sqlite-vec as vlasky#23, and on asg017/sqlite-vec as asg017#341, where only
sqlite3_vec_init()remains of the three.