Skip to content

Commit

Permalink
fix warning in intel19 strnlen implicit
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jun 6, 2019
1 parent f96b039 commit e69191d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
#==============================================================================
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])

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 e69191d

Please sign in to comment.