zed
zed copied to clipboard
Compilation error on 32 bit platforms in zed/runtime/expr
This line of code in zed/runtime/expr/sort.go
if max := math.MaxUint32; n > max {
fails to compile in 32 bit mode as such:
runtime/expr/sort.go:27:12: cannot use math.MaxUint32 (untyped int constant 4294967295) as int value in assignment (overflows)
To fix the code, you can e.g. add a cast like this:
if max := math.MaxUint32; int64(n) > max {
I'll plan to add some text in the CONTRIBUTING doc to set expectations that 32-bit is not currently supported and point to this issue if users want to vote to boost the priority. If I can figure out how to rig up the Makefile to prevent compilation on 32-bit architectures I'll do that as well.
Sounds good! I'm just a porter/packager. Please do what is most appropriate for your projects needs.
In #4433 text was added to the CONTRIBUTING doc to emphasize that compilation on 32-bit is not currently supported. The same PR also changed the Makefile to detect if this is attempted and exit with an error message.
This issue will remain open to gather interest in adding 32-bit support. Users that find their way here should add a comment describing their use case. Thanks!