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

I find this a very strange response: "this technique doesn't work if I have to comply with an external standard." Fine, then don't use the technique.

Although, I believe the more common approach is to define two structs: one using the packed standardized layout, and one using a layout more suited for whatever you're actually doing. In that case, you may wish to consider sorting the elements by size and alignment for the internal use-only layout.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: