Skip to content

Commit

Permalink
Merge pull request ESMCI#1472 from jedwards4b/jedwards/strnlen_fix
Browse files Browse the repository at this point in the history
Jedwards/strnlen fix
  • Loading branch information
edhartnett authored Jun 6, 2019
2 parents 2d3528b + c77ceac commit f754949
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmake_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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.])])

Expand Down
4 changes: 2 additions & 2 deletions tests/cunit/test_iosystem3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit f754949

Please sign in to comment.