2017-01-12 3:04 GMT+01:00 Warren Young:
> In fact, one improvement made to SQLite a few years ago was to switch it from 
> using native Windows file locking when built under Cygwin to use POSIX or BSD 
> locking mechanisms, so that two programs built under Cygwin that both used 
> SQLite would get the advisory locking semantics they expect, not the 
> mandatory locking semantics Windows gives you by default.  (It’s more 
> complicated than that, but I don’t want to go deeper into it here.)

Yeah ...  I'm slowly trying to submit all portability issues I discover
back to the SQLite developers, so far with little success.

For example, the following patch fixes possible crashes in
error-handling in 64-bit builds (not Cygwin-specific). Explanation:
On 64-bit builds '0' is a 32-bit integer, but Tcl_AppendResult()
expects a NULL-pointer as last element which is 64-bit.

Any chance for this to be in the next SQLite release?

Thanks!
        Jan Nijtmans
=======================================
$ fossil diff
Index: src/tclsqlite.c
==================================================================
--- src/tclsqlite.c
+++ src/tclsqlite.c
@@ -2534,11 +2534,11 @@
     for(i=3; i<(objc-1); i++){
       const char *z = Tcl_GetString(objv[i]);
       int n = strlen30(z);
       if( n>2 && strncmp(z, "-argcount",n)==0 ){
         if( i==(objc-2) ){
-          Tcl_AppendResult(interp, "option requires an argument: ", z, 0);
+          Tcl_AppendResult(interp, "option requires an argument: ",
z, (char *)0);
           return TCL_ERROR;
         }
         if( Tcl_GetIntFromObj(interp, objv[i+1], &nArg) ) return TCL_ERROR;
         if( nArg<0 ){
           Tcl_AppendResult(interp, "number of arguments must be non-negative",
@@ -2549,11 +2549,11 @@
       }else
       if( n>2 && strncmp(z, "-deterministic",n)==0 ){
         flags |= SQLITE_DETERMINISTIC;
       }else{
         Tcl_AppendResult(interp, "bad option \"", z,
-            "\": must be -argcount or -deterministic", 0
+            "\": must be -argcount or -deterministic", (char *)0
         );
         return TCL_ERROR;
       }
     }

@@ -3206,11 +3206,11 @@
         if( rc==SQLITE_OK ){
           Tcl_Obj *pObj;
           pObj = Tcl_NewStringObj((char*)sqlite3_value_text(pValue), -1);
           Tcl_SetObjResult(interp, pObj);
         }else{
-          Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), 0);
+          Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), (char *)0);
           return TCL_ERROR;
         }
       }
     }
 #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to