agrep
agrep copied to clipboard
Completion of error handling
I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.
Would you like to add more error handling for return values from functions like the following?
@elfring Hello, thanks for your suggestion, which I appreciate.
Please can you be so kind to file a formal PR (pull request) with a working(!) and tested(!) code, which can be added to the present methods.
I suggest to avoid ignorance of return values a bit more.
Are you interested to apply aspect-oriented software development? How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?
@elfring you wrote
I suggest to avoid ignorance of return values a bit more.
Yes, that was what I tried when porting this "piece" of software to OS/2 and DOS in 90ies - later I backported to Linux. The software was and is ugly (even the main author, Udi, agreed) and needs massive refactoring. So the underlying goal should be: keep it working (agrep can be compiled for many platforms, and we should not break this), but clean up messy things.
Personally, I don't have any free resources to fix also these things, and would be happy, if I can avoid all compiler warnings (there are so many, I tried to fix the "missing function prototype" issues, but could not even fix all of them)
@elfring perhaps you can starting working and helping me here: try to help to bring the compiler warnings to an absolute mininum.
Can a tool like "Artistic Style" help here?
How do you think about to improve static source code analysis also for your software?
Do you find information sources like the following useful?
- Article "A Reusable Aspect for Memory Allocation Checking"
- Document "Aspect-Oriented Software Development - An Introduction" by Johan Brichau and Theo D'Hondt
- Paper "On Typesafe Aspect Implementations in C++" by Daniel Lohmann and Olaf Spinczyk