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

Enable C++ exceptions on the codebase #3325

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Sep 23, 2024

Jan Engelheart pointed out that with -fno-exceptions new failing will return a nullptr. Which seems fine until you realize that all of rpm is built on the notion that allocations never fail, they terminate the program instead. Only with the C++ refactorings, a significant portion of the code is now relying on new and not checking its return. Ooops.

Uncaught exceptions will terminate an unsuspecting program anyhow, let that happen. We'll be adding catches over time...

Besides allocations, not being able to deal with exceptions in the C++ side of things would put us at severe handicap all over the place - they are an essential part of the language and STL.

Jan Engelheart pointed out that with -fno-exceptions `new` failing
will return a nullptr. Which seems fine until you realize that all
of rpm is built on the notion that allocations never fail, they
terminate the program instead. Only with the C++ refactorings, a
significant portion of the code is now relying on `new` and not checking
its return. Ooops.

Uncaught exceptions will terminate an unsuspecting program anyhow,
let that happen. We'll be adding catches over time...

Besides allocations, not being able to deal with exceptions in the C++
side of things would put us at severe handicap all over the place - they
are an essential part of the language and STL.
@pmatilai pmatilai requested a review from a team as a code owner September 23, 2024 10:30
@pmatilai pmatilai requested review from dmnks and removed request for a team September 23, 2024 10:30
@ffesti ffesti merged commit af534c9 into rpm-software-management:master Sep 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants