Skip to content

Commit

Permalink
Use c++17 fallthrough; remove unused fallthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Oct 12, 2022
1 parent 7d93c29 commit 3595c0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 3 additions & 1 deletion packages/seacas/applications/nem_slice/elb.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@

#define MAX_INP_LINE 10240

#if defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER
#if (__cplusplus >= 201703L)
#define FALL_THROUGH [[fallthrough]]
#elif defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER
#define FALL_THROUGH [[gnu::fallthrough]]
#else
#define FALL_THROUGH ((void)0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(C) 1999-2021 National Technology & Engineering Solutions
* Copyright(C) 1999-2022 National Technology & Engineering Solutions
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
* NTESS, the U.S. Government retains certain rights in this software.
*
Expand All @@ -26,11 +26,13 @@
template <typename INT> struct ELEM_COMM_MAP;
template <typename INT> struct NODE_COMM_MAP;

#if defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER
#if (__cplusplus >= 201703L)
#define FALL_THROUGH [[fallthrough]]
#elif defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER
#define FALL_THROUGH [[gnu::fallthrough]]
#else
#define FALL_THROUGH ((void)0)
#endif /* __GNUC__ >= 7 */
#endif

namespace {
template <typename INT>
Expand Down
6 changes: 0 additions & 6 deletions packages/seacas/libraries/ioss/src/Ioss_FaceGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@

#define DO_TIMING 0

#if defined(__GNUC__) && __GNUC__ >= 7 && !__INTEL_COMPILER
#define FALL_THROUGH [[gnu::fallthrough]]
#else
#define FALL_THROUGH ((void)0)
#endif /* __GNUC__ >= 7 */

namespace {
template <typename T> void generate_index(std::vector<T> &index)
{
Expand Down

0 comments on commit 3595c0b

Please sign in to comment.