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

Config support for fallthrough attribute #2717

Merged
merged 6 commits into from Jun 28, 2017

Conversation

mcopik
Copy link
Contributor

@mcopik mcopik commented Jun 26, 2017

Adds a feature test for C++17 [[fallthrough]] and removes gcc 7.1 warnings complaining about a possible fallthrough.

#include <hpx/config/defines.hpp>

#if defined(HPX_HAVE_CXX17_FALLTHROUGH_ATTRIBUTE)
# define HPX_FALLTHROUGH [[fallthrough]];
Copy link
Member

@hkaiser hkaiser Jun 26, 2017

Choose a reason for hiding this comment

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

I'd suggest to remove the semicolon from the macro definition. Let's leave this to the user. This is not a big issue, some compilers warn about duplicate semicolons, though...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Duplicate semicolon because the user may follow the macro with a semicolon?
HPX_FALLTHROUGH;

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that's what I meant. But the main rationale would be to have the semicolon in user code. A casual reader might not 'know' that HPX_FALLTHROUGH is a macro...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, thanks for the review! Fixed.

Copy link
Member

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@hkaiser hkaiser merged commit a80816f into STEllAR-GROUP:master Jun 28, 2017
@hkaiser
Copy link
Member

hkaiser commented Jun 29, 2017

FWIW: this describes how things are implemented in gcc: https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

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.

None yet

2 participants