Better HN
topnewbestaskshowjobs
Log inSign up

clarebear123

1 karma · joined Feb 14, 2023 (3y ago) · 4 submissions

Submissions

comment 2y ago · link · parent

Do you know if compilers are smart enough to return 04 even on big-endian architectures nowadays? For some reason I'm under the impression that (at least clang and gcc) are able to change this from "first byte in x" to "least significant byte in x" but don't actually know why I think that. Maybe embedded compilers typically don't?

comment 2y ago · link · parent

I just ran it on my M2 mac and got 04. Don't compilers typically take endianness into account for things like this anyway?

comment 2y ago · link · parent

What architectures would it not be 04 on?

comment 2y ago · link · parent

Yea I didn't want to watch the video and had no idea what it was, my best guess was it was a quirky non-smart phone, never occurred to me it might be a "companion device" whatever that is exactly.