Attention is currently required from: laforge, neels, pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35212?usp=email )
Change subject: ecu: force alignment of member data in struct osmo_ecu_state ......................................................................
Patch Set 5:
(1 comment)
File src/codec/ecu_fr.c:
https://gerrit.osmocom.org/c/libosmocore/+/35212/comment/5c265b1f_519cd1ac PS4, Line 294: return (struct osmo_ecu_state*) fr;
while the cast is fine, the container_of would probably be safer and would allow this struct to be a […]
As it seems I am having difficulties to understand your idea. I do not understand how container_of/offsetof can be used to find a simpler/safer solution.
I could think of using offsetof on data[] to get its offset and then use that offset to calculate the next aligned address to place the private struct there.
It would be great if you could point me to an example.