From e69191daff036813a19cbad25c052702ef8541c2 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 6 Jun 2019 08:35:05 -0600 Subject: [PATCH] fix warning in intel19 strnlen implicit --- CMakeLists.txt | 2 ++ configure.ac | 3 +++ tests/cunit/test_iosystem3.c | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79f997a8b7c..907107d66a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,8 @@ else() set(USE_MPI_SERIAL 0) endif() +#Set in config.h to solve intel 19 strnlen warning issue +set(_GNU_SOURCE, 1) #============================================================================== # PREPEND TO CMAKE MODULE PATH #============================================================================== diff --git a/configure.ac b/configure.ac index a61c1a0a98d..d6ce4aaa44c 100644 --- a/configure.ac +++ b/configure.ac @@ -236,6 +236,9 @@ AC_CONFIG_FILES([tests/general/pio_tutil.F90:tests/general/util/pio_tutil.F90]) AC_CONFIG_LINKS([tests/unit/input.nl:tests/unit/input.nl]) +# Define to solve intel compiler warning. +AC_DEFINE([_GNU_SOURCE], [1], [solve strnlen declared implicitly warning on intel compiler]) + # Create the config.h file. AC_CONFIG_HEADERS([config.h]) 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)))