Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endianness of serialized ints is undefined (compiler-dependent) #39

Open
ecc1 opened this issue Dec 15, 2017 · 0 comments
Open

endianness of serialized ints is undefined (compiler-dependent) #39

ecc1 opened this issue Dec 15, 2017 · 0 comments

Comments

@ecc1
Copy link
Contributor

ecc1 commented Dec 15, 2017

In the serial.c code

uint16_t serial_rx_word() {
  return (serial_rx_byte() << 8) + serial_rx_byte();
}

the order of the calls to serial_rx_byte is undefined (up to the C compiler). Similarly for serial_rx_long. So the endianness is not well-defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant