-
-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion of error handling #3
Comments
Changed (and a bit more). 2013/9/5 Markus Elfring notifications@github.com
|
Thanks for your improvement. I find it still incomplete.
Are you interested in aspect-oriented software development? |
Fixed. |
The added value check is wrong. How do you think about an approach like the following?
Do you prefer a different reaction than a crash because of a null pointer that might be returned from the function "de265_new_decoder"? I guess that it would be nice if the function "de265_init" will acknowledge by a return value if the initialisation of your software library was really successful. Would you like to care for return values also from functions like "fwrite" and "fclose"? Would you like to add an annotation like "warn_unused_result" to any function of your API? |
No, on contrary, your approach is wrong. Because at the end of a file, fread will return a value smaller than BUFFER_SIZE when it reads the final bytes. I do not want to care about errors in fclose(). First, because that code is not used (only debugging), second, because I have never seen this fail, third, because I have far more important things to add. |
You could add the check for "feof(fh)" in the else branch. ;-) I hope that return value ignorance can be changed. |
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?
The text was updated successfully, but these errors were encountered: