Building sqlite3 for tcl8 redefines typedef
Closed / Fixedad08bca6b16d069fb303d20f7feebd0952eff38dCreated 234 days agoUpdated 227 days ago
Descriptionplain2026-04-13 01:47:19
tcl.h does this:
#if TCL_MAJOR_VERSION < 9
# ifndef Tcl_Size
typedef int Tcl_Size;
# endif
...
tclsqlite3.c does this:
#if TCL_MAJOR_VERSION==9
# define CONST const
#elif !defined(Tcl_Size)
typedef int Tcl_Size;
#endif
Since Tcl_Size is never defined as a macro, the #ifndef guards don't help, and pre-C11 compilers error like so:
/opt/bblocal/var/buildworker/base/build/vendor/tcl/pkgs/sqlite3.51.0/generic/tclsqlite3.c:56:15: error: redefinition of typedef 'Tcl_Size' is invalid in C [-Wtypedef-redefinition]
typedef int Tcl_Size;
^
In file included from /opt/bblocal/var/buildworker/base/build/vendor/tcl/pkgs/sqlite3.51.0/generic/tclsqlite3.c:47:
/opt/bblocal/var/buildworker/base/build/vendor/tcl/generic/tcl.h:326:17: note: previous definition is here
typedef int Tcl_Size;
^
Referenced by3
7c1522f896Follow-up to [ad08bca6b1] fix: unbreak Thread build with Tcl 8 headers (user: jan.nijtmans) check-in2026-04-20 11:59:1267ebec8a77Follow-up to [ad08bca6b1] fix: unbreak Itcl build with Tcl 8 headers check-in2026-04-19 19:46:16b6a50a0482Fix [ad08bca6b1]: Building sqlite3 for tcl8 redefines typedef check-in2026-04-15 08:29:46
jan.nijtmanswiki2026-04-15 08:31:56
Thanks for the report!
Should be fixed [here]. Done in Tcl, because sqlite3 won't be the only extension suffering from this when using a pre-c11 compiler.
pre-c11 compilers are dying out, that's most likely the reason this wasn't reported before.
apnadkarnimarkdown2026-04-16 11:56:45
Re-opened because GH builds break on all platforms.
apnadkarniplain2026-04-16 11:57:57
Closing - race condition in re-opening and fix being committed.
jan.nijtmanswiki2026-04-20 11:53:26
See also d3f41333aa, which is also an instance of basically the same bug.
Log in (anonymous is fine) to add a comment.