Skip to content

all: replace C.int with i32#26522

Open
kbkpbot wants to merge 1 commit intovlang:masterfrom
kbkpbot:fix-c-int-2-i32
Open

all: replace C.int with i32#26522
kbkpbot wants to merge 1 commit intovlang:masterfrom
kbkpbot:fix-c-int-2-i32

Conversation

@kbkpbot
Copy link
Contributor

@kbkpbot kbkpbot commented Feb 5, 2026

v fmt -new_int -w .

This will convert all C.xx(xx int) int to C.xx(xx i32) i32
As int will be platform depend, i32 or i64.

related to PR #25298, #25236

BTW: I think we can fix checker to issue a notice about use int in C function declaration.

@JalonSolov
Copy link
Contributor

Not sure this is a good idea. According to C specs, the size of int and all other integer types are implementation defined. The only guarantee is that int will be at least large enough to handle i16 range of values.

On some C compilers (mostly older ones), int == i16. On most modern compilers, int == i32, but on some, int == i32 for 32-bit targets, and int == i64 on 64-bit targets.

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.

2 participants