SQLite Forum

3.44.2 fail to compile on Win with SQLITE_OMIT_WAL=1
Login

3.44.2 fail to compile on Win with SQLITE_OMIT_WAL=1

(1) By Daniel Sahlberg (dsahlberg) on 2023-12-22 12:58:32 [source]

Hi,

The Subversion project include the SQLite amalgamation into our build tree. We defining SQLITE_OMIT_WAL=1 in our compile options.

3.44.2 fails to build with the following error: [[[ C:researchsvndevdeps64srcsqlite-amalgamation-3.44.2.0sqlite3.c(34597,42): error C4013: 'sqlite3PagerWalSystemErrno' undefined; assuming extern returning int [C:researchsvndevsubversion-1.14.3buildwin32vcnet-vcprojlibsvn_subr.vcxproj] ]]]

The declaration is guarded by:

#if defined(SQLITE_USE_SEH) && !defined(SQLITE_OMIT_WAL)

While the actual use seems to be guarded by

#ifdef SQLITE_USE_SEH

Is this an error in 3.44 or does SQLITE_OMIT_WAL=1 require SQLITE_USE_SEH=0?

Kind regards, Daniel Sahlberg

(2.1) By Stephan Beal (stephan) on 2023-12-22 15:14:08 edited from 2.0 in reply to 1 [link] [source]

Is this an error in 3.44 or does SQLITE_OMIT_WAL=1 require SQLITE_USE_SEH=0?

That was apparently fixed after the release so that the #if's now match up:

#ifdef SQLITE_USE_SEH
int sqlite3PagerWalSystemErrno(Pager *pPager){
  return sqlite3WalSystemErrno(pPager->pWal);
}
#endif

The one use of that function (in util.c) is guarded by that same #ifdef.

Edit: correction - those code blocks are both listed as having been modified on August 11, 2023, which was before the release. Investigating...

(3) By Stephan Beal (stephan) on 2023-12-22 15:50:59 in reply to 1 [link] [source]

Is this an error in 3.44 or does SQLITE_OMIT_WAL=1 require SQLITE_USE_SEH=0?

SEH is indeed not intended to be used if OMIT_WAL is defined. We've just patched the trunk and 3.44 branch to correct those #if's so that the build won't break when both OMIT_WAL and USE_SEH=1 are defined (the latter is set automatically under MSVC unless SQLITE_OMIT_SEH is defined).

The patch is fairly trivial if you'd like to hand-patch your amalgamation, otherwise you'll need to either adjust your build flags to -DSQLITE_OMIT_SEH -DSQLITE_OMIT_WAL (should work) or wait for the next release of 3.45 or 3.44.3 (noting that it's not yet certain whether there will be a 3.44.3 release).

(4) By Daniel Sahlberg (dsahlberg) on 2023-12-28 18:32:50 in reply to 3 [link] [source]

Thanks!

I checked and the patch resolves the issue.

There is no need to push a release for us.