From 9d954e1136e8b511d0f44eac25c9eafd3b155549 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 9 Oct 2013 11:55:33 -0500 Subject: [svn-r24270] checkin coverity changes from 10/4/2013. tested with h5committest --- hl/src/H5LTanalyze.c | 9 ++++++--- src/H5private.h | 3 +++ tools/h5diff/h5diffgentest.c | 2 +- tools/h5repack/h5repack_main.c | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index f02bed6..c3e5d73 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -14,9 +14,11 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This file was generated by Lex with the command "lex -PH5LTyy -oH5LTanalyze.c H5LTanalyze.l". - * Do NOT modify it by hand, but in line 52, "#ifdef H5_HAVE_UNISTD_H" should be added if - * the platform doesn't have the unistd.h header file. + * This file was generated by Lex with the command "lex -PH5LTyy + * -oH5LTanalyze.c H5LTanalyze.l". Do NOT modify it by hand, but in + * line 52, "#ifdef H5_HAVE_UNISTD_H" should be added if the platform + * doesn't have the unistd.h header file. Also hdf5.h should be added + * before adding H5_HAVE_UNISTD_H. */ #define yy_create_buffer H5LTyy_create_buffer @@ -49,6 +51,7 @@ #define YY_FLEX_MINOR_VERSION 5 #include +#include #ifdef H5_HAVE_UNISTD_H #include #endif diff --git a/src/H5private.h b/src/H5private.h index 984f7da..0e6ff1e 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -277,12 +277,15 @@ #ifdef __cplusplus # define __attribute__(X) /*void*/ # define UNUSED /*void*/ +# define NORETURN /*void*/ #else /* __cplusplus */ #ifdef H5_HAVE_ATTRIBUTE # define UNUSED __attribute__((unused)) +# define NORETURN __attribute__((noreturn)) #else # define __attribute__(X) /*void*/ # define UNUSED /*void*/ +# define NORETURN /*void*/ #endif #endif /* __cplusplus */ diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 2271703..d7389d3 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -4874,7 +4874,7 @@ static void test_data_nocomparables (const char * fname, int make_diffs) int data1[DIM_ARRY] = {0,0,0}; int data2[DIM_ARRY] = {1,1,1}; int data3[DIM_ARRY+1] = {1,1,1,1}; - int data1_dim2[DIM_ARRY][1] = {0,0,0}; + int data1_dim2[DIM_ARRY][1] = {{0},{0},{0}}; int rank_attr; char data1_str[DIM_ARRY][STR_SIZE]= {"ab","cd","ef"}; herr_t status = SUCCEED; diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 7d92e4b..bc7b4e5 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -21,6 +21,8 @@ #define PROGRAMNAME "h5repack" static int parse_command_line(int argc, const char **argv, pack_opt_t* options); +static void leave(int ret) NORETURN; + /* module-scoped variables */ static int has_i_o = 0; @@ -563,7 +565,6 @@ done: int main(int argc, const char **argv) { pack_opt_t options; /*the global options */ - int ret = -1; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); -- cgit v0.12