Comment Comment by unwind Just for completeness' sake: bit fields are a feature in plain old C too, and the syntax is the same [1].Their most "obnoxious" feature is that the layout is implementation defined, so they are not very portable between compilers and/or architectures.Often used in an embedded setting to model hardware registers, when you can know/control what compiler implementation is used.[1]: https://en.wikipedia.org/wiki/Bit_field#C_programming_langua...Edit: more with the words. parent unwind 1 year ago
Their most "obnoxious" feature is that the layout is implementation defined, so they are not very portable between compilers and/or architectures.
Often used in an embedded setting to model hardware registers, when you can know/control what compiler implementation is used.
[1]: https://en.wikipedia.org/wiki/Bit_field#C_programming_langua...
Edit: more with the words.