Skip to content

Commit

Permalink
Disable fallthrough attributes for the Intel compilers on Linux and M…
Browse files Browse the repository at this point in the history
…acOS (#1879)

* Disable fallthrough attributes for the Intel compilers

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.

* Rearrange ifdef logic for excluding pre-C++17 fallthrough attributes

This puts Intel and PGI compilers into a separate group
and thus makes the intent and logic more obvious.
  • Loading branch information
akohlmey authored Sep 18, 2020
1 parent 45da432 commit bc51a8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@
#endif

#if __cplusplus == 201103L || __cplusplus == 201402L
# if defined(__clang__)
# if defined(__INTEL_COMPILER) || defined(__PGI)
# define FMT_FALLTHROUGH
# elif defined(__clang__)
# define FMT_FALLTHROUGH [[clang::fallthrough]]
# elif FMT_GCC_VERSION >= 700 && !defined(__PGI) && \
# elif FMT_GCC_VERSION >= 700 && \
(!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 520)
# define FMT_FALLTHROUGH [[gnu::fallthrough]]
# else
Expand Down

0 comments on commit bc51a8d

Please sign in to comment.