Skip to content

Trying to compile on gcc without warnings.#668

Open
nksauter wants to merge 1 commit into
masterfrom
squash_warn
Open

Trying to compile on gcc without warnings.#668
nksauter wants to merge 1 commit into
masterfrom
squash_warn

Conversation

@nksauter

@nksauter nksauter commented Oct 8, 2021

Copy link
Copy Markdown
Contributor

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

nksauter commented Oct 8, 2021

Copy link
Copy Markdown
Contributor Author

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.

Comment thread libtbx/SConscript
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
Copy Markdown
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

nksauter commented Oct 8, 2021

Copy link
Copy Markdown
Contributor Author

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

bkpoon commented Oct 8, 2021

Copy link
Copy Markdown
Member

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