Fossil SCM

Give sqlcmd_autoinit() the signature that SQLite calls an automatic extension with. The undefined behavior sanitizer of Clang reports the call through a pointer to a different function type.

dmestas 2026-11-13 23:39 UTC small-fixes-2
Commit 4af860df3834d77e56d6ab8a0f62a106f067f050c84146e38e84c0a406c81241
1 file changed +2 -2
+2 -2
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -210,12 +210,12 @@
210210
** the connection to the repository database is opened. Set up the
211211
** database connection to be more useful to the human operator.
212212
*/
213213
static int sqlcmd_autoinit(
214214
sqlite3 *db,
215
- const char **pzErrMsg,
216
- const void *notUsed
215
+ char **pzErrMsg,
216
+ const sqlite3_api_routines *notUsed
217217
){
218218
int mTrace = SQLITE_TRACE_CLOSE;
219219
add_content_sql_commands(db);
220220
db_add_aux_functions(db);
221221
re_add_sql_func(db);
222222
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -210,12 +210,12 @@
210 ** the connection to the repository database is opened. Set up the
211 ** database connection to be more useful to the human operator.
212 */
213 static int sqlcmd_autoinit(
214 sqlite3 *db,
215 const char **pzErrMsg,
216 const void *notUsed
217 ){
218 int mTrace = SQLITE_TRACE_CLOSE;
219 add_content_sql_commands(db);
220 db_add_aux_functions(db);
221 re_add_sql_func(db);
222
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -210,12 +210,12 @@
210 ** the connection to the repository database is opened. Set up the
211 ** database connection to be more useful to the human operator.
212 */
213 static int sqlcmd_autoinit(
214 sqlite3 *db,
215 char **pzErrMsg,
216 const sqlite3_api_routines *notUsed
217 ){
218 int mTrace = SQLITE_TRACE_CLOSE;
219 add_content_sql_commands(db);
220 db_add_aux_functions(db);
221 re_add_sql_func(db);
222

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button