Tcl Source Code

View Ticket
Login
Ticket UUID: ad08bca6b16d069fb303d20f7feebd0952eff38d
Title: Building sqlite3 for tcl8 redefines typedef
Type: Bug Created on: 2026-04-13 01:47:19
Submitter: anonymous Assigned to: jan.nijtmans
Subsystem: 81. Bundled Packages Severity: Important
Priority: 5 Medium Last modified: 2026-04-20 11:53:26
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-04-20 11:53:26
Version: 9.0.3
Description:
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;
                ^
User Comments:
jan.nijtmans added on 2026-04-15 08:31:56:

Thanks for the report!

Should be fixed [b6a50a0482cf3db3|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.


apnadkarni added on 2026-04-16 11:56:45:

Re-opened because GH builds break on all platforms.


apnadkarni added on 2026-04-16 11:57:57:
Closing - race condition in re-opening and fix being committed.

jan.nijtmans added on 2026-04-20 11:53:26:

See also d3f41333aa, which is also an instance of basically the same bug.