I have this code:
big_endian_warn :: proc() {
endianCheck: struct #raw_union {
u64: u64,
u8: u8,
}
endianCheck.u8 = 1
if endianCheck.u64 != u64(endianCheck.u8) {
fmt.println("WARNING: Your CPU is Big-Endian, test results will be different!")
}
}
Is this correct?
And is there a more succinct way?
