diff --git a/cmake_config.h.in b/cmake_config.h.in index 8a94219163d..cfd26d77601 100644 --- a/cmake_config.h.in +++ b/cmake_config.h.in @@ -5,6 +5,8 @@ */ #ifndef _PIO_CONFIG_ #define _PIO_CONFIG_ +/* Set to avoid warning in intel19 compiler wrt strnlen */ +#define _GNU_SOURCE /** The major part of the version number. */ #define PIO_VERSION_MAJOR @VERSION_MAJOR@ diff --git a/configure.ac b/configure.ac index 567c5e40f6e..6964e7f9639 100644 --- a/configure.ac +++ b/configure.ac @@ -156,6 +156,9 @@ AC_DEFINE([INCLUDE_CMAKE_FCI], [1], [defined by CMake build]) # All builds are on LINUX. AC_DEFINE([LINUX], [1], [defined by CMake build]) +# Define to solve intel compiler warning. +AC_DEFINE([_GNU_SOURCE], [1], [solve strnlen declared implicitly warning on intel compiler]) + # Check for netCDF library. AC_CHECK_LIB([netcdf], [nc_create], [], [AC_MSG_ERROR([Can't find or link to the netcdf library.])]) diff --git a/tests/cunit/test_iosystem3.c b/tests/cunit/test_iosystem3.c index 6470a91c16f..1c91b00c5c4 100644 --- a/tests/cunit/test_iosystem3.c +++ b/tests/cunit/test_iosystem3.c @@ -158,7 +158,7 @@ int main(int argc, char **argv) int num_flavors; /* Number of PIO netCDF flavors in this build. */ int flavor[NUM_FLAVORS]; /* iotypes for the supported netCDF IO flavors. */ int rearranger[NUM_REARRANGERS] = {PIO_REARR_BOX, PIO_REARR_SUBSET}; - + /* Figure out iotypes. */ if ((ret = get_iotypes(&num_flavors, flavor))) ERR(ret); @@ -314,7 +314,7 @@ int main(int argc, char **argv) ERR(ret); } /* next iotype */ - + /* Finalize PIO systems. */ if (even_comm != MPI_COMM_NULL) if ((ret = PIOc_free_iosystem(even_iosysid)))