Skip to content

Commit 9220f02

Browse files
committed
IOSS: Fix compiler warnings in parallel build with IOSS_ERROR
1 parent 5af87d0 commit 9220f02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/seacas/libraries/ioss/src/Ioss_Utils.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ namespace Ioss {
3838
[[noreturn]] inline void IOSS_ERROR(const std::string &errmsg)
3939
{
4040
#if defined(SEACAS_HAVE_MPI)
41-
std::cerr "ERROR: " << errmsg << "\n";
42-
MPI_Abort(MPI_COMM_WORLD);
43-
#else
44-
throw std::runtime_error(errmsg);
41+
std::cerr << "ERROR: " << errmsg << "\n";
42+
MPI_Abort(MPI_COMM_WORLD, 1);
43+
// MPI_Abort should not return, but if it does, we throw the exception...
44+
// This helps quiet the compiler also.
4545
#endif
46+
throw std::runtime_error(errmsg);
4647
}
4748

4849
[[noreturn]] inline void IOSS_ERROR(const std::ostringstream &errmsg) { IOSS_ERROR(errmsg.str()); }

0 commit comments

Comments
 (0)