Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It is indeed part of the standard. It says "Within a structure object, the non-bit-field members and the units in which bit-fields reside have addresses that increase in the order in which they are declared"[1] which doesn't allow implementations to reorder fields, at least according to my understanding.

[1] https://open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf section 6.7.3.2, paragraph 17.



i was talking abt padding/alignment, not ordering, that's indeed not allowed you're right




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: