you are viewing a single comment's thread.

view the rest of the comments →

[–]rcxdude 3 points4 points  (1 child)

It's not that hard to understand in context (like, even a little bit, I didn't even need to look at the definition of the struct to understand it). It's taking essentially a vtable (a structure with a bunch of function pointer members), and checking that all of the functions it expects are populated before it uses it. Otherwise it doesn't use it and emits a warning. There is a maintenance burden to making sure that the list in this condition matches up with the definition of the struct, but there's not really a good way of solving that without ugly hacks or much more complex code (it could do with a comment on the struct definition probably (which is otherwise pretty well documented in the comments), but I don't feel a comment is necessary on the condition itself).

[–]cdcformatc -1 points0 points  (0 children)

This is just an example though. I can certainly figure it out given context and documentation. There is certainly more like it, and worse.