agrep icon indicating copy to clipboard operation
agrep copied to clipboard

Completion of error handling

Open elfring opened this issue 10 years ago • 4 comments

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 avatar Sep 29 '14 21:09 elfring

@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.

Wikinaut avatar Oct 02 '14 13:10 Wikinaut

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 avatar Oct 02 '14 13:10 elfring

@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.

Wikinaut avatar Oct 02 '14 13:10 Wikinaut

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?

elfring avatar Oct 02 '14 14:10 elfring