docs: int is platform width, not always 32-bit - #28876
quaesitor-scientiam wants to merge 2 commits into
Conversation
|
There are several errors in examples. For instance, https://github.com/vlang/v/actions/runs/35810344048/job/107020291499?pr=28876#step:6:11 is saying that |
docs.md:927/:8832 on master been broken since 2026-08-21 To make it green again will require researching a separate fix |
|
You're right — both are real failures, and my date above was wrong: 2026-08-21 is only when master's Docs CI last passed. The two examples broke later, one day apart:
With both merged, |
|
Now that #28882 has been merged, try merging master here to ensure the fix took care of things. |
|
If no further issues can this be merged |
|
See my comment just before yours. |
Since vlang#28293 (25f5ced) `int` lowers to `i64` on 64-bit targets and to `i32` on 32-bit ones, but the Primitive types note still said "Unlike C and Go, `int` is always a 32 bit integer". The raw inline-assembly example had the same stale assumption: it used `addl` on two `int` operands, which fails under gcc with "incorrect register `%rax' used with `l' suffix" (the same problem as vlang#28870). Its operands are now `i32`, with a sentence on why. Co-Authored-By: WOZCODE <contact@withwoz.com>
55d43d2 rejects `sql` as a parameter name, so the "Calling C from V" SQLite example no longer compiled: error: unexpected keyword `sql`, expecting name That is one of the two examples that make `check-markdown` fail on master. Rename the parameter of `C.sqlite3_exec` to `query`. Co-Authored-By: WOZCODE <contact@withwoz.com>
fcf1bb2 to
0ac62c8
Compare
Rebased with master CI jobs running |
The Primitive types note in
doc/docs.mdsays:That has not been true since #28293 (
25f5ced70b), which madeintplatform width; that commit touched nothing underdoc/. Checked against the generated C on masterc9b806b294:v -arch <arch> -o w.cofx := 19amd64i64 x = 19;i386i32 x = 19;Changes
The note now says
intis 64 bits on 64-bit targets and 32 bits on 32-bit targets, and points toi32/i64for a fixed width.The raw inline-assembly example used
addlon twointoperands. Copied as written, it fails under gcc with the same error as Inline assembly tests use 32-bit mnemonic suffixes on platform-intoperands, so they fail to assemble under gcc/clang #28870:Its operands are now
i32, followed by one sentence explaining why, since this is an easy trap for anyone porting 32-bit inline assembly.-cc gcc-cc <bundled tcc>42i32operands4242Checks
v check-md doc/docs.md: 3 errors and 2 formatting errors, at lines 928, 6015 and 8833. Unmodified master reports exactly the same set at 927, 6014 and 8832 (the one-line shift is the longer note), so none come from this change. Both edits are prose or av ignoreblock.🧙 Built with WOZCODE