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

Trying to compile on gcc without warnings. #668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nksauter
Copy link
Contributor

@nksauter nksauter commented Oct 8, 2021

Three warnings can be safety suppressed, but it would be better if
the underlying code could be fixed so no gcc warnings are generated.

Three warnings can be safety suppressed, but it would be better if
the underlying code could be fixed so no gcc warnings are generated.
@nksauter
Copy link
Contributor Author

nksauter commented Oct 8, 2021

Would like to be able to compile all code with libtbx.scons without generating gcc warnings. These three warning suppressions are currently needed (-Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-terminate"). Initiating a conversation in the hope that the underlying code can be fixed, so that these warning suppressions aren't needed. Asking for developer review.

warn_options = ["-w",
"-Wno-deprecated-declarations",# deep in boost python stack
"-Wno-maybe-uninitialized",#boost/boost/python/extract.hpp:185
"-Wno-terminate",# dials difficulty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nksauter aim is to initiate conversation about underlying code issues - here you tag dials -> let's discuss.

I too would like to live in a world where our compilers did not complain at length about our code. It has never sat well with me.

What is the error?

@nksauter
Copy link
Contributor Author

nksauter commented Oct 8, 2021

I'm specifically asking @bkpoon for information about fixing the underlying code, because I seem to remember discussing one of the warnings. I'm attaching a file showing the warnings squashed by -Wno-terminate in hope that this will restart the discussion.
terminate_squash_warns.pdf

@bkpoon
Copy link
Member

bkpoon commented Oct 8, 2021

The throw will always call terminate() should be similar to the warnings we had from fable. To fix the warnings in fable, we set the destructor to noexcept(false). We have the fable/noexcept_false.hpp header in fable to get rid of the warnings. Basically, an exception may be thrown in the destructor. In C++11, the default behavior is to not allow exceptions to be thrown in the destructor.

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