@mhoye The problem is not documentation, it's the C programming language.
While C is an excellent and elegant language in many ways, it's simply not designed with user-friendliness in mind.
It doesn't even offer basic type safety, as your example plainly demonstrates, letting the user do extremely destructive things that they would almost never want to do, with almost no guardrails.
It is legal to send an integer where a pointer is expected. That's C. Can't fix that with an instruction manual.