Skip to content
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

[BUG] Completion of error handling #1496

Closed
elfring opened this issue Jan 10, 2025 · 7 comments
Closed

[BUG] Completion of error handling #1496

elfring opened this issue Jan 10, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@elfring
Copy link

elfring commented Jan 10, 2025

Would you like to add more error handling for return values from functions like the following?

@elfring elfring added the bug Something isn't working label Jan 10, 2025
@CarterLi
Copy link
Member

No. We dont check results of *allocs. Just let the program crash if they fail.

@CarterLi
Copy link
Member

BTW what static checker are you using?

@elfring
Copy link
Author

elfring commented Jan 10, 2025

💭 I hope that you would like to avoid undefined behaviour.
How do you think about to improve static source code analysis also for this software? 🤔

@CarterLi
Copy link
Member

In modern system, malloc should almost never fail because swap exists. One exception is programming bug such as malloc(-1). In this case I would rather let the program to crash and generate some stack traces or core dump file so I can find where the bug is and fix it.

@elfring
Copy link
Author

elfring commented Jan 10, 2025

💭 Some software users tend to prefer defined behaviour.


Some functions are known where return values can be overlooked.
👀 Thus questionable places can be found also by the means of GitHub source code search interfaces.

@CarterLi
Copy link
Member

Modern compilers are already smart enough to detect some UBs. We also use ASAN and UBSAN. I think it's enough for me.

@CarterLi CarterLi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
@elfring
Copy link
Author

elfring commented Jan 10, 2025

🔮 How will chances evolve to benefit any more also from the means of aspect-oriented software development?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants