What about all function calls within igraph get automatically wrapped in IGRAPH_CHECK by the compiler/preprocessor if they define a variable:
int err_code
?
I’m a little unsure how to get it done in practice but we could set it up and then slowly change that return variable name into all appropriate functions to simplify the code.
What do you guys think?
Might it be an idea to setup a linter for checking PRs instead of building a preprocessor? That way, we could perhaps check more things when submittings PRs. Making sure that IGRAPH_CHECK
is called is just one thing, we could then perhaps also check
- Matching number of
IGRAPH_FINALLY
and IGRAPH_FINALLY_CLEAN
.
- Whether
IGRAPH_SUCCESS
is properly returned.
- Whether
IGRAPH_FINALLY
signature matches object definition.
- …
Oh I like the linter idea. Less automatic that can fail and more convention enforcement. Let me do a little research. Had anyone written I’ve if those?