I am currently working on a program where I need to store big integer values, big enough that they don't fit into uint32
. Only int64
or uint64
.
I just realized the Raspberry Pi Zero v1.3
, that I will be using for this project, has Broadcom BCM2835 processor
, which I believe is a 32 bit
architecture processor.
It contains an ARM1176JZFS (ARM11 using an ARMv6-architecture core) with floating point, running at 1GHz
How do I ensure my program functions correctly on this 32 bit architecture? Do I have to do anything differently? Or does the compiler is able to handle this without a problem when I cross compile it: env GOOS=linux GOARCH=arm GOARM=6 go build
?
First, the disclaimer: I don't write 32-bit code, so what I say may be incomplete.
According to the language spec, the only architecture dependent types are int, uint, and uintptr. That means, you have to go back and check every piece of data and function argument declared as one of these types. You also have to check any untyped numeric literal (declared constants and literal values) passes as interface{}, because those will be passed as int as well.