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

Bitfields have undefined byte order/endianness #49

Open
extremeheat opened this issue Sep 26, 2023 · 2 comments
Open

Bitfields have undefined byte order/endianness #49

extremeheat opened this issue Sep 26, 2023 · 2 comments

Comments

@extremeheat
Copy link
Contributor

Whether or not bitfields are encoded as little or big endian, reading back in the wrong order will cause bitfields to be incorrectly read. Right now they are implied to be big endian, which should be added to the doc.

A way to specify little endian could be helpful, as numerical encoding in any non-Java/JVM language is little endian by default. Also, would be nice to have a explicit note that the highest bit on a unpacked integer should be the sign bit in two's complement.

@extremeheat extremeheat changed the title Bitfields have undefined endianess Bitfields have undefined byte order/endianness Sep 26, 2023
@rom1504
Copy link
Member

rom1504 commented Sep 26, 2023 via email

@extremeheat
Copy link
Contributor Author

No, it's not necessary, I just ran into this issue writing https://github.com/extremeheat/protodef-cpp

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

2 participants