From 2ad4aae706e30091cac6a9ca4c02ebb9b79e2bed Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Thu, 27 Jun 2019 11:07:00 -0600 Subject: [PATCH 1/2] turning on -Werror for C compiler --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index beb81d10968..7f012a505b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ env: script: - autoreconf -i - - export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer' + - export CFLAGS='-std=c99 -fsanitize=address -fno-omit-frame-pointer -Werror' - export FFLAGS='-fsanitize=address -fno-omit-frame-pointer' - export FCFLAGS='-fsanitize=address -fno-omit-frame-pointer' - export DISTCHECK_CONFIGURE_FLAGS='--enable-fortran' From a0b4d54377024a93b3aebd74aa6f0fb85af2c3b4 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Thu, 27 Jun 2019 11:41:36 -0600 Subject: [PATCH 2/2] fixed example --- examples/c/darray_async.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/examples/c/darray_async.c b/examples/c/darray_async.c index 1dce8144200..8d490657296 100644 --- a/examples/c/darray_async.c +++ b/examples/c/darray_async.c @@ -71,31 +71,6 @@ int dim_len[NDIM3] = {NC_UNLIMITED, DIM_LEN_X, DIM_LEN_Y}; /* Names of dimensions. */ char dim_name[NDIM3][PIO_MAX_NAME + 1] = {"unlimted", "x", "y"}; -/* Handle MPI errors. This should only be used with MPI library - * function calls. */ -#define MPIERR(e) do { \ - MPI_Error_string(e, err_buffer, &resultlen); \ - printf("MPI error, line %d, file %s: %s\n", __LINE__, __FILE__, err_buffer); \ - MPI_Finalize(); \ - return 2; \ - } while (0) - -/* Handle non-MPI errors by finalizing the MPI library and exiting - * with an exit code. */ -#define ERR(e) do { \ - MPI_Finalize(); \ - return e; \ - } while (0) - -/* Global err buffer for MPI. When there is an MPI error, this buffer - * is used to store the error message that is associated with the MPI - * error. */ -char err_buffer[MPI_MAX_ERROR_STRING]; - -/* This is the length of the most recent MPI error message, stored - * int the global error string. */ -int resultlen; - /* @brief Check the output file. * * Use netCDF to check that the output is as expected.