On 11/29/06, Ralf Junker <[EMAIL PROTECTED]> wrote:
* SQLITE_EXTENSION_INIT1

If I compile both fts1 and fts2 into the same executable with

  -DSQLITE_CORE=1
  -DSQLITE_ENABLE_FTS1=1
  -DSQLITE_ENABLE_FTS2=1

I receive a linker warning that sqlite3_api is defined in both fts1.c and 
fts2.c.

The warning goes away if I remove SQLITE_EXTENSION_INIT1 from both units.
I might be wrong, but maybe this is not necessary if the library is compiled 
with
SQLITE_CORE=1?

Unfortunately, I don't see this warning on my Ubuntu box, but it makes
sense, since the variables aren't declared static.  This is actually
perfectly valid in C, but probably not really what's intended in this
case.  My suspicion is that the right fix is either to make
sqlite3_api static (attached diff1.txt), or to do away with it
entirely under SQLITE_CORE (attached diff2.txt).

Richard, since this is in the virtual table interface, do you have any
strong opinion?

* fts1.c:

Variable i is never used in function static char *firstToken(char *zIn, char 
**pzTail).

Variable j is never used in function static int parseSpec(TableSpec *pSpec, int 
argc,
const char *const*argv, char**pzErr)

* fts2.c:

Both warnings above also apply to fts2.

Fixed, thanks.

-scott
Index: src/sqlite3ext.h
===================================================================
RCS file: /sqlite/sqlite/src/sqlite3ext.h,v
retrieving revision 1.7
diff -u -r1.7 sqlite3ext.h
--- src/sqlite3ext.h    22 Sep 2006 23:38:21 -0000      1.7
+++ src/sqlite3ext.h    29 Nov 2006 23:45:31 -0000
@@ -276,7 +276,7 @@
 #define sqlite3_overload_function      sqlite3_api->overload_function
 #endif /* SQLITE_CORE */
 
-#define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api;
+#define SQLITE_EXTENSION_INIT1     static const sqlite3_api_routines 
*sqlite3_api;
 #define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;
 
 #endif /* _SQLITE3EXT_H_ */
Index: src/sqlite3ext.h
===================================================================
RCS file: /sqlite/sqlite/src/sqlite3ext.h,v
retrieving revision 1.7
diff -u -r1.7 sqlite3ext.h
--- src/sqlite3ext.h    22 Sep 2006 23:38:21 -0000      1.7
+++ src/sqlite3ext.h    29 Nov 2006 23:46:22 -0000
@@ -276,7 +276,12 @@
 #define sqlite3_overload_function      sqlite3_api->overload_function
 #endif /* SQLITE_CORE */
 
+#ifdef SQLITE_CORE
+#define SQLITE_EXTENSION_INIT1
+#define SQLITE_EXTENSION_INIT2(v)
+#else
 #define SQLITE_EXTENSION_INIT1     const sqlite3_api_routines *sqlite3_api;
 #define SQLITE_EXTENSION_INIT2(v)  sqlite3_api = v;
+#endif
 
 #endif /* _SQLITE3EXT_H_ */
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to