From bc4ace4371ca1f6d2ae104e9705abdf6d1d90467 Mon Sep 17 00:00:00 2001 From: Aaron Paterson Date: Fri, 23 Oct 2026 01:55:54 -0500 Subject: [PATCH] Mark sqlite3_vec_init's pApi unused under SQLITE_CORE Compiled with -DSQLITE_CORE, as when sqlite-vec.c is built into SQLite or an application, sqlite3_vec_init() never reads its pApi parameter, since SQLITE_EXTENSION_INIT2() is its only use and SQLITE_CORE leaves it out. With -Wall -Wextra it warns: gcc -Ivendor -Wall -Wextra -DSQLITE_CORE -DSQLITE_VEC_STATIC \ -c sqlite-vec.c -o vec.o sqlite-vec.c:10633:65: warning: unused parameter 'pApi' It now marks it with UNUSED_PARAMETER() in that case. The command no longer prints that warning with gcc 14.2 or clang 19.1, and the loadable extension, built without SQLITE_CORE, is unchanged. --- sqlite-vec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sqlite-vec.c b/sqlite-vec.c index 7af3b6a7..27986900 100644 --- a/sqlite-vec.c +++ b/sqlite-vec.c @@ -10633,6 +10633,8 @@ SQLITE_VEC_API int sqlite3_vec_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) { #ifndef SQLITE_CORE SQLITE_EXTENSION_INIT2(pApi); +#else + UNUSED_PARAMETER(pApi); #endif int rc = SQLITE_OK;