microzig icon indicating copy to clipboard operation
microzig copied to clipboard

Compile error on Raspberry Pi

Open Ku-Be opened this issue 2 years ago • 1 comments

Building a microzig project on a Raspberry Pi 2 fails with this error:

/home/pi/.cache/zig/p/1220af58bdaa721b8189f3a7adfda660517dd354463463388e96d69fe4ceccf80b92/build.zig:161:55: error: expected type 'usize', found 'u64'
                .elf, .bin, .hex, .dfu, .esp => |val| {
                                                      ^
/home/pi/.cache/zig/p/1220af58bdaa721b8189f3a7adfda660517dd354463463388e96d69fe4ceccf80b92/build.zig:161:55: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values

What could be the reason for this? Maybe because the Pi's CPU is 32 bit, and u64 is hardcoded somewhere?

Ku-Be avatar Oct 03 '23 21:10 Ku-Be

The reason here is the invalid use of usize instead of u64 for a platform independent size

ikskuh avatar Oct 04 '23 06:10 ikskuh