Commit 607a073c authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Enable extra warnings with clang compiler

Clang supports pretty much the same warning arguments as gcc. Removed
the cast-align warning since much of the IceT pointer magic sets this
warning off.

Also fixed a bad comment that the warnings alerted me to.
parent 909df185
......@@ -167,9 +167,13 @@ ENDIF (ICET_USE_MPI)
# Add extra warnings when possible. The IceT build should be clean. I expect
# no warnings when bulding this code.
IF (CMAKE_COMPILER_IS_GNUCC)
SET(ICET_C_FLAGS_WARN "-ansi -Wall -Wno-long-long -Wcast-align -Wextra -Wformat-security -Wshadow -Wunused -Wreturn-type -Wpointer-arith -Wdeclaration-after-statement")
ENDIF (CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
SET(CMAKE_COMPILER_IS_CLANG 1)
ENDIF()
IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
SET(ICET_C_FLAGS_WARN "-ansi -Wall -Wno-long-long -Wextra -Wformat-security -Wshadow -Wunused -Wreturn-type -Wpointer-arith -Wdeclaration-after-statement")
ENDIF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
# Configure testing support.
IF (BUILD_TESTING)
......
......@@ -231,11 +231,11 @@ IceTCommunicator icetCreateMPICommunicator(MPI_Comm mpi_comm)
MPI_Errhandler_create(ErrorHandler, &eh);
MPI_Errhandler_set(*((MPI_Comm *)comm->data), eh);
MPI_Errhandler_free(&eh);
#else // MPI_VERSION >= 2
#else /* MPI_VERSION >= 2 */
MPI_Comm_create_errhandler(ErrorHandler, &eh);
MPI_Comm_set_errhandler(*((MPI_Comm *)comm->data), eh);
MPI_Errhandler_free(&eh);
#endif // MPI_VERSION >= 2
#endif /* MPI_VERSION >= 2 */
#endif
return comm;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment