Skip to content

Make the ThreadScan definition in thw3.c match its declaration - #318

Open
defmacro-jam wants to merge 1 commit into
Ravenbrook:masterfrom
defmacro-jam:branch/2026-10-19/thw3-threadscan-signature
Open

defmacro-jam wants to merge 1 commit into
Ravenbrook:masterfrom
defmacro-jam:branch/2026-10-19/thw3-threadscan-signature

Conversation

@defmacro-jam

@defmacro-jam defmacro-jam commented Oct 20, 2026 •

Copy link
Copy Markdown

Fixes #317.

code/th.h:71 declares ThreadScan's third parameter as void *stackCold, as do the definitions in than.c, thix.c and thxc.c, but code/thw3.c:262 defined it as Word *stackCold. Clang (22.1.8, as clang-cl targeting x86_64-pc-windows-msvc) rejects the mismatch as conflicting types when building mps.c for w3i6mv.

The change is the parameter type only. The function body assigns stackCold to a Word * and passes it to StackScan, whose parameter is void *, so nothing else changes. The line keeps its length, so the continuation line's alignment is unchanged.

Tested by building mps.c with this change under clang-cl 22.1.8 on GitLab's hosted Windows runner: the conflicting-types error is gone. Not tested with Microsoft cl.

code/th.h declares ThreadScan's stackCold parameter as void *, as do
the definitions in than.c, thix.c and thxc.c, but thw3.c defined it
as Word *. Clang rejects the mismatch as conflicting types when building
w3i6mv with clang-cl. The body assigns stackCold to a Word * and passes
it to StackScan, whose parameter is void *, so no other change is needed.

Fixes GitHub issue Ravenbrook#317 <Ravenbrook#317>.
@defmacro-jam
defmacro-jam force-pushed the branch/2026-10-19/thw3-threadscan-signature branch from 11a35c7 to 3957bbe Compare October 20, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

thw3.c: ThreadScan definition conflicts with its declaration in th.h

1 participant