From 9fced482f2079c5379bc2d8302bc65e1a4358012 Mon Sep 17 00:00:00 2001 From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Date: Wed, 17 Feb 2021 08:54:58 -0600 Subject: 1 12 merge recent changes from develop (#344) * OESS-98 fix tools test for plugins * sync fork * Merge of changes from dev * Move problem option to bottom of the list until fixed * HDFFV-11106 - fix parsing optional args * HDFFV-11106 add note * grammer fix * Whitespace after clang formatting * Undo format version 11 changes * Update check to working version * Merge workflow and minor changes from develop * Update supported platforms * PR#3 merge from develop * Merge gcc 10 diagnostics option from develop * Merge #318 OSX changes from develop * Merge serval small changes from dev * fix typo --- CMakeLists.txt | 2 +- bin/genparser | 7 ++++++- config/cmake/H5pubconf.h.in | 23 +++++++++++++++++++---- hl/examples/ex_ds1.c | 4 +++- hl/fortran/examples/ex_ds1.f90 | 3 ++- hl/src/H5LTanalyze.c | 4 +++- hl/src/H5LTparse.c | 4 +++- tools/lib/h5tools_dump.c | 5 ++++- 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 58874cf..1ce8dbc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ string (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) string (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) -string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._\-]*)\".*$" +string (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z._-]*)\".*$" "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (TRACE "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") diff --git a/bin/genparser b/bin/genparser index ab40775..183b3c9 100755 --- a/bin/genparser +++ b/bin/genparser @@ -219,13 +219,15 @@ perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5 # # Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions # will simply ignore them, but we want to avoid those warnings. +# +# Note also that although clang defines __GNUC__, it doesn't support every +# warning that GCC does. for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c do echo '#if defined (__GNUC__) ' >> tmp.out echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out - echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wmissing-prototypes" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wnested-externs" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wold-style-definition" ' >> tmp.out @@ -234,8 +236,11 @@ do echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-overflow" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out + echo '#if !defined (__clang__) ' >> tmp.out + echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" ' >> tmp.out + echo '#endif ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f436989..5df524d 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -605,6 +605,7 @@ #cmakedefine H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@ #if !defined(__APPLE__) + /* The size of `size_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@ @@ -614,8 +615,17 @@ /* The size of `long', as computed by sizeof. */ #cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@ +/* The size of `long double', as computed by sizeof. */ +#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + #else - # if defined(__LP64__) && __LP64__ + + /* On Apple, to support Universal Binaries (where multiple CPU + architectures exist in one library/executable), we can't assume + the machine doing the compiling has the same endianness or type + sizes as all the various architectures (PowerPC, Intel, ARM). */ + + # if defined(__LP64__) && __LP64__ #define H5_SIZEOF_LONG 8 #define H5_SIZEOF_SIZE_T 8 #define H5_SIZEOF_SSIZE_T 8 @@ -625,10 +635,15 @@ #define H5_SIZEOF_SSIZE_T 4 # endif -#endif + # if defined(__i386__) || defined(__x86_64__) + #define H5_SIZEOF_LONG_DOUBLE 16 + # elif defined(__aarch64__) + #define H5_SIZEOF_LONG_DOUBLE 8 + # else + #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ + # endif -/* The size of `long double', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@ +#endif /* Define size of long long and/or __int64 bit integer type only if the type exists. */ diff --git a/hl/examples/ex_ds1.c b/hl/examples/ex_ds1.c index af8b581..09f398b 100644 --- a/hl/examples/ex_ds1.c +++ b/hl/examples/ex_ds1.c @@ -91,9 +91,11 @@ main(void) if (H5DSattach_scale(did, dsid, DIM1) < 0) goto out; - /* close DS id */ + /* close DS ids */ if (H5Dclose(dsid) < 0) goto out; + if (H5Dclose(did) < 0) + goto out; /* close file */ H5Fclose(fid); diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 index b31ac8e..3e0048a 100644 --- a/hl/fortran/examples/ex_ds1.f90 +++ b/hl/fortran/examples/ex_ds1.f90 @@ -180,8 +180,9 @@ PROGRAM example_ds WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len) - ! close DS id + ! close DS ids CALL H5Dclose_f(dsid, err) + CALL H5Dclose_f(did, err) ! close file CALL H5Fclose_f(fid, err) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 4adf3d3..3c6983a 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -2,7 +2,6 @@ #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wnested-externs" #pragma GCC diagnostic ignored "-Wold-style-definition" @@ -11,8 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 80de0a2..2ef133f 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -2,7 +2,6 @@ #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wnested-externs" #pragma GCC diagnostic ignored "-Wold-style-definition" @@ -11,8 +10,11 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wstrict-overflow" #pragma GCC diagnostic ignored "-Wstrict-prototypes" +#if !defined (__clang__) +#pragma GCC diagnostic ignored "-Wlarger-than=" #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" #pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" +#endif #pragma GCC diagnostic ignored "-Wswitch-default" #pragma GCC diagnostic ignored "-Wunused-function" #pragma GCC diagnostic ignored "-Wunused-macros" diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 56ffd27..d5a9c1d 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -329,7 +329,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, h5tools_cont * Purpose: Print some values from an attribute referenced by object reference. * * Description: - * This is a special case subfunction to dump aa attribute references. + * This is a special case subfunction to dump an attribute reference. * * Return: * The function returns False if the last dimension has been reached, otherwise True @@ -448,6 +448,9 @@ done: if (H5Tclose(atype) < 0) H5TOOLS_ERROR(dimension_break, "H5Tclose failed"); + if (H5Sclose(region_space) < 0) + H5TOOLS_ERROR(dimension_break, "H5Sclose failed"); + ctx->indent_level--; ctx->need_prefix = TRUE; -- cgit v0.12