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

Disable fallthrough attributes for the Intel compilers on Linux and MacOS #1879

Merged
merged 2 commits into from
Sep 18, 2020

Conversation

akohlmey
Copy link
Contributor

On MacOS and Linux the Intel compilers may be identified as the host compilers (Clang or GNU) but do not support the corresponding compiler specific fallthrough attributes. This pull request adds conditions to the preprocessor tests to skip using those in those cases.

I agree that my contributions are licensed under the {fmt} license, and agree to future changes to the licensing.

On MacOS and Linux the Intel compilers may be identified as the
host compilers (Clang or GNU) but do not support the corresponding
compiler specific fallthrough attributes.
Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@@ -70,9 +70,9 @@
#endif

#if __cplusplus == 201103L || __cplusplus == 201402L
# if defined(__clang__)
# if defined(__clang__) && !defined(__INTEL_COMPILER)
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest moving the Intel compiler check in a branch of its own, something like

#  ifdef __INTEL_COMPILER
#    define FMT_FALLTHROUGH
#  elif ...

to avoid repetition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about something like this? looks like PGI falls into the same category.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

This puts Intel and PGI compilers into a separate group
and thus makes the intent and logic more obvious.
@vitaut vitaut merged commit bc51a8d into fmtlib:master Sep 18, 2020
@akohlmey akohlmey deleted the intel-compiler-fallthrough branch September 18, 2020 18:14
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.

2 participants