Re:AI Detectors Falsely Accuse Students of Cheating–With Big...
by clarebear123 on Monday October 21, 2024 @02:24PM
(#41906885)
I just ran it on my M2 mac and got 04. Don't compilers typically take endianness into account for things like this anyway?
[ Parent
| on HN ]
Re:AI Detectors Falsely Accuse Students of Cheating–With Big...
by odo1242 on Monday October 21, 2024 @06:26PM
(#41909218)
No, compilers don’t take endianness into account. (especially not C)
You need to use a bit mask in order to make this code endian-independent rather than a pointer alias. Like (uint8_t)(int & 0xFF), or something like that.