x/sys/unix: C->Go type converter does not take integer field sign into account #44794
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
I am looking at Linux
statfs
structure that is defined in Linux UAPI as__statfs_word
is marked as unsigned 32bit at 32bit platforms.Now let's look at the generated code for a 32bit platform e.g.
arm
(unix/ztypes_linux_arm.go):Here
Type
field is signed int that differs from the UAPI intention.This causes issues with a compiled code, like this for example:
This code fails to compile for arm because
unix.RAMFS_MAGIC
is 0x858458f6 and does not match int32 at the left side.statfs.Type
should really be auint32
type.The text was updated successfully, but these errors were encountered: