Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-05-02
06:39 • Closed ticket [1615c80638]: gcc warnings compiling in 32-bit mode plus 5 oth... artifact: 8d8d666224 user: apnadkarni
06:39 • Ticket [1615c80638]: 3 changes artifact: bd028e1227 user: apnadkarni
06:20 • Ticket [1615c80638]: 3 changes artifact: efe158581c user: apnadkarni
2026-05-01
16:00 • Open ticket [1615c80638]. artifact: 967c5dcf39 user: jan.nijtmans
2026-04-30
16:06 • Closed ticket [1615c80638]. artifact: ca29917abe user: dkf
16:04
Fix [1615c80638] by moving problem comparisons to common helper function check-in: 5a2d03a86e user: dkf tags: trunk, main
2026-03-13
10:47 • Ticket [1615c80638] gcc warnings compiling in 32-bit mode status still Open ... artifact: 44ab38417e user: stu
2026-01-06
04:20 • Ticket [1615c80638]: 3 changes artifact: 396dcfd419 user: cdubois
2025-12-08
15:08 • Ticket [1615c80638]: 4 changes artifact: ece0f7a683 user: jan.nijtmans
2025-12-05
03:15 • Ticket [1615c80638]: 3 changes artifact: d7617b3de1 user: chrstphrchvz
2025-06-04
04:42 • New ticket [1615c80638]. artifact: 479651fff9 user: apnadkarni

gcc warnings compiling in 32-bit mode

Closed / Fixed1615c806389ed4e58b4091714c8503cccabf49e4Created 2 years agoUpdated 215 days ago
Descriptionmarkdown2025-06-04 04:42:23

gcc spits out a bunch of warnings similar to below for compiling for 32-bit architectures:

C:/src/tcltk/wip/tcl/generic/tclCompCmds.c: In function 'TclCompileAppendCmd':
C:/src/tcltk/wip/tcl/generic/tclCompCmds.c:144:35: warning: comparison of integer expressions of different signedness: 'Tcl_Size' {aka 'int'} and 'unsigned int' [-Wsign-compare]
  144 |     if (numWords == 1 || numWords > UINT_MAX) {

The comparison does not make sense on 32-bit archs as the expression will never be true. More important, the number of warnings output means potentially serious warnings are missed.

Referenced by1
  • 5a2d03a86eFix [1615c80638] by moving problem comparisons to common helper function check-in2026-04-30 16:04:22
chrstphrchvzmarkdown2025-12-05 03:15:51

I believe the version for this ticket should be 9.1. I don't think 9.0 or earlier are affected.

jan.nijtmanswiki2025-12-08 15:08:26

Those changes were introduced with [this] commit (TIP 720: Bytecode generation improvements/sanity).

Therefore, assigning to @dkf

cduboisplain2026-01-06 04:20:23
Thanks for the pointers regarding TIP 720.

I’ll try to reproduce the -Wsign-compare warnings in a true 32-bit build (either an i386 container or a multilib -m32 build). I’ll report back with the exact gcc version/flags and whether this reproduces on 9.0.2 vs current development (9.1/trunk).

If confirmed, I can propose a patch to make the comparisons type-safe and verify it by rebuilding (and running relevant tests) on 32-bit.
stuplain2026-03-13 10:47:13
In 9.1a1: 43 warnings like this, in:
generic/tclCompCmds.c
generic/tclCompCmdsGR.c
generic/tclCompCmdsSZ.c
dkfmarkdown2026-04-30 16:06:49

Ought to be resolved, or at least fewer error messages (max one per compiled file). Done by moving the comparison to a static inline function in tclCompile.h; if my implementation in there isn't right, fix it in that one place.

Works for me now.

jan.nijtmanswiki2026-05-01 16:00:58

Well, 9.1 build is broken now, even worse at it was:

https://github.com/tcltk/tcl/actions/runs/25206800733

Tests ended at 2026-05-01 07:53:02 UTC
all.tcl:	Total	481605	Passed	475243	Skipped	6295	Failed	67
Sourced 173 Test Files.
Files with failing tests: compExpr.test coroutine.test dict.test info.test interp.test lmap.test mathop.test nre.test oo.test regexpComp.test stack.test trace.test

Re-opening

apnadkarniplain2026-05-02 06:20:43
Failures also present on 32-bit Windows. As an aside, I'm a bit surprised GH CI does not include Windows 32-bit config.
apnadkarniplain2026-05-02 06:39:48
Fixed in [5ae9991e]. Verified on mingw32, vc++ 32 and gcc 64.
apnadkarni Closed ticket [1615c80638]. [History diff]2026-05-02 06:39:59
Log in (anonymous is fine) to add a comment.