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

Boost includes: use BOOST_ALLOW_DEPRECATED_HEADERS to suppress warnings #13021

Merged
merged 2 commits into from Dec 1, 2021

Conversation

tamiko
Copy link
Member

@tamiko tamiko commented Dec 1, 2021

Close #13020

@tamiko tamiko requested a review from bangerth December 1, 2021 03:46
#define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
#define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
#include <boost/geometry/index/rtree.hpp>
int main() { return 0; }
Copy link
Member Author

@tamiko tamiko Dec 1, 2021

Choose a reason for hiding this comment

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

@bangerth This isn't particularly pretty but it works: I had to override the BOOST_HEADER_DEPRECATED(a) macro in order to force a compilation error. -Werror doesn't help here because a #pragma message is not a warning...

Copy link
Member

Choose a reason for hiding this comment

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

Ah, clever. That's why my test didn't fail.

Copy link
Member

@bangerth bangerth left a comment

Choose a reason for hiding this comment

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

That works. I think I would have just added -DBOOST_ALLOW_DEPRECATED_HEADERS to the compile flags directly in the cmake script. This way you don't have to touch the sources, but you're still specific which versions of BOOST receive the treatment.

#define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED
#define BOOST_HEADER_DEPRECATED(a) _Pragma(\"GCC error \\\"stop compilation\\\"\");
#include <boost/geometry/index/rtree.hpp>
int main() { return 0; }
Copy link
Member

Choose a reason for hiding this comment

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

Ah, clever. That's why my test didn't fail.

@tamiko
Copy link
Member Author

tamiko commented Dec 1, 2021

/rebuild

@kronbichler kronbichler merged commit d745029 into dealii:master Dec 1, 2021
@tamiko tamiko deleted the avoid_spurious_boost_warnings branch January 4, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BOOST uses deprecated BOOST headers :-(
3 participants