Closed gsegt closed 9 months ago
What a heck is going on this MR?!
I mean this is not the way it should be done. Later l could provide an example
For some reason, I expected that outcome. I'll have another go at it. Are you interested in the thought process of how this solution came to be?
So, I wanted to add checks on every system calls and every function that use a pointer.
I wanted to have a common error code and more explicit message than a basic "Passed a NULL pointer", hence the code to store them.
I did not want to use defines
as my understanding was that it is recommended to use constants instead, so I used some. Plus, it put the structure to have more in the future.
Finally, I made a function to not repeat myself with the checks.
This is how the code of this PR came to be.
Now, I am open to suggestions on how to improve it and have another go at it.
I had another go at it with assert and a MACRO. I thought that having a function would be a bit cleaner, even with the macro. Let me know what you think.
Can you tell me why? I really don't get what is wrong with this second implementation.
This is an outdated comment l made a concilium to actually get the point way this solution is actually right. Can be merged
This PR has been rebased on main, I'll let you have another look since quite a bit changed since the solution you approved was made.
I feel like I over did this one a bit XD