Attention is currently required from: arehbein, daniel, laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35079?usp=email )
Change subject: osmo_io: Remove union in struct osmo_io_ops ......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
I disagree that we should put the burden of this onto the user. It's an easy enough mistake to make. […]
So you set mode (which is usually a hardcoded value in the code), and then an ops, which is also a hardcoded struct pointing to known functions, which is a union known by the user of the API.
To me it's fine. To me what you say it's like making a claim that you open an AF_INET socket and then something is wrong becuase you pass an AF_INET6 address to some API... I agree it would be nice to have more protection there, but current state is good enough for me, specially since changing it has the 2 drawbacks I mentioned early (ABI break, more memory needed per fd).
That's my current opinion, let's see if other have other opinions here.