Completion of error handling
elfring opened this issue · 15 comments
I'll take a handle for xtload() for fopen. Not too concerned with calloc or fopen for writes failing.
I suggest to avoid ignorance of return values a bit more.
Would you like to detect every error situation as early as possible?
A little overkill in my opinion
I prefer a more complete error detection and exception handling.
Okay, I'll pop in ecalloc() and efopen() wrappers
assertations for callocs and fopens were added instead
actually, now that I think about it, asserts can be disabled globally. efopen and ecalloc were added instead.
Thanks for your small source code improvement.
There are still more function calls to reconsider.
scanf you mean? I'll patch it
Functions like fclose() and fprintf() will need also further software development attention, won't they?
No, assuming that efopen() was successful, fclose() and fprintf() can be used without worry.
Your assumptions are questionable in this case. There are additional failure possibilities to consider.
How do you think about to improve static source code analysis also for your software?
I rely on runtime analysis with valgrind. Static analysis is typically overkill at times. The metrics supplied by gcc's -Wall and -Wextra is usually enough.
Would you like to extend the development methodology with any software tools?
Developments done for the most part as this is a practice in minimalism, If you're looking for a fully developed neural net library then checkout FANN (https://github.com/libfann/fann).