From 3b594992d6b062cf350d3f03e4b5c5d27b83a245 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 2 Jul 2019 23:43:45 -0500 Subject: Add support for GCC9, update warnhist script, and clean up warnings. --- MANIFEST | 1 + bin/genparser | 2 +- bin/warnhist | 279 ++++++++++++++----- config/gnu-flags | 71 ++++- hl/src/H5LTanalyze.c | 201 +++++++------- hl/src/H5LTanalyze.l | 5 +- hl/src/H5LTparse.c | 532 +++++++++++++++++++------------------ hl/src/H5LTparse.h | 15 +- hl/tools/gif2h5/gif2mem.c | 3 +- src/H5Adense.c | 5 +- src/H5Dchunk.c | 8 +- src/H5Dint.c | 5 +- src/H5FDmulti.c | 14 +- src/H5Fint.c | 11 +- src/H5Fpkg.h | 16 +- src/H5Fsuper.c | 1 - src/H5I.c | 90 +++---- src/H5Opline.c | 4 +- src/H5Osdspace.c | 4 +- src/H5PLpath.c | 4 +- src/H5Pint.c | 2 +- src/H5T.c | 4 +- src/H5Toh.c | 1 + src/H5system.c | 4 +- test/CMakeLists.txt | 1 + test/enc_dec_plist.c | 4 +- test/external.c | 3 +- test/external_common.h | 12 +- test/external_env.c | 1 + test/external_fname.h | 37 +++ test/fheap.c | 41 +-- test/h5test.c | 2 +- test/h5test.h | 2 +- test/ohdr.c | 4 +- test/tid.c | 2 +- test/ttsafe_error.c | 2 +- test/vds.c | 4 +- test/vds_env.c | 4 +- test/vds_swmr.h | 48 ---- test/vds_swmr_gen.c | 46 ++++ test/vds_swmr_reader.c | 2 + tools/lib/h5diff_array.c | 2 +- tools/lib/h5diff_util.c | 6 +- tools/lib/h5trav.c | 2 +- tools/src/h5repack/h5repack_refs.c | 24 +- tools/test/misc/h5clear_gentest.c | 2 +- tools/test/perform/chunk_cache.c | 6 +- tools/test/perform/perf.c | 21 +- 48 files changed, 909 insertions(+), 651 deletions(-) create mode 100644 test/external_fname.h diff --git a/MANIFEST b/MANIFEST index 3285ec2..b4ee3b0 100644 --- a/MANIFEST +++ b/MANIFEST @@ -999,6 +999,7 @@ ./test/external_common.c ./test/external_common.h ./test/external_env.c +./test/external_fname.h ./test/error_test.c ./test/err_compat.c ./test/filter_error.h5 diff --git a/bin/genparser b/bin/genparser index 8cf6ec2..e6aee5b 100755 --- a/bin/genparser +++ b/bin/genparser @@ -218,7 +218,7 @@ perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5 # will simply ignore them, but we want to avoid those warnings. for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c do - echo '#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 ' >> tmp.out + echo '#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ ' >> 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 diff --git a/bin/warnhist b/bin/warnhist index df7565e..499886b 100755 --- a/bin/warnhist +++ b/bin/warnhist @@ -40,6 +40,8 @@ my @ignorenames; my %ignored_files = (); my %warn_file_indices = (); my %file_warn_indices = (); +my @warn_match_strings; +my @file_match_strings; my %file_warn = (); my %file_warn_line = (); my $current_warning = 0; @@ -49,14 +51,10 @@ my $last_c_name; my $last_fort_name; my $last_fort_line; -# declare the Perl command line flags/options we want to allow -my %options=(); -getopts("FWht:w:f:i:l", \%options); - -# Display usage, if requested -if($options{h}) { - print "Usage: 'warnhist [-h] [-t ] [-w ] [-W] [-f ] [-F] [-l] [-i [file]'\n"; - print "\t-h\tDisplay this usage\n"; +# Display usage +sub do_help { + print "Usage: 'warnhist [-h, --help] [-t ] [-w ] [-W] [-f ] [-F] [-s ] [-S ] [file]'\n"; + print "\t-h, --help\tDisplay this usage\n"; print "\t-t \tTrim pathname prefix from filenames, \n"; print "\t-w \tDisplay files for a given warning index list, \n"; print "\t\t can be a single value, a range, or a comma separated list\n"; @@ -66,6 +64,12 @@ if($options{h}) { print "\t\t can be a single value, a range, or a comma separated list\n"; print "\t\tFor example: '0' or '0,4' or '8-10' or '0,2-4,8-10,13'\n"; print "\t-F\tDisplay warnings for all files\n"; + print "\t-s \tDisplay files for warnings which contain a string, \n"; + print "\t\t is a comma separated list, with no spaces\n"; + print "\t\tFor example: 'Wunused-dummy-argument' or 'Wunused-dummy-argument,Wunused-variable'\n"; + print "\t-S \tDisplay warnings for files which contain a string, \n"; + print "\t\t is a comma separated list, with no spaces\n"; + print "\t\tFor example: 'H5Fint' or 'H5Fint,H5Gnode'\n"; print "\t-l\tDisplay line nunbers for file/warning\n"; print "\t-i \tIgnore named files, \n"; print "\t\t is a comma separated list, with no spaces\n"; @@ -75,6 +79,19 @@ if($options{h}) { exit; } +sub main::HELP_MESSAGE { + do_help(); +} + +# declare the Perl command line flags/options we want to allow +my %options=(); +getopts("FWht:w:f:s:S:i:l", \%options); + +# Display usage, if requested +if($options{h}) { + do_help(); +} + # Parse list of file names to ignore if(exists $options{i}) { @ignorenames = split /,/, $options{i}; @@ -98,13 +115,13 @@ if(exists $options{w}) { #print "start_index = '$start_index', end_index = '$end_index'\n"; for my $y ($start_index..$end_index) { #print "y = '$y'\n"; - if(!(exists $warn_file_indices{$y})) { + if(!exists $warn_file_indices{$y}) { $warn_file_indices{$y} = $y; } } } else { - if(!(exists $warn_file_indices{$x})) { + if(!exists $warn_file_indices{$x}) { $warn_file_indices{$x} = $x; } } @@ -114,6 +131,12 @@ if(exists $options{w}) { #} } +# Parse list of warning strings to expand file names +if(exists $options{s}) { + @warn_match_strings = split /,/, $options{s}; +# print @warn_match_strings; +} + # Parse list of file indices to expand warnings if(exists $options{f}) { my @tmp_indices; @@ -131,13 +154,13 @@ if(exists $options{f}) { #print "start_index = '$start_index', end_index = '$end_index'\n"; for my $y ($start_index..$end_index) { #print "y = '$y'\n"; - if(!(exists $file_warn_indices{$y})) { + if(!exists $file_warn_indices{$y}) { $file_warn_indices{$y} = $y; } } } else { - if(!(exists $file_warn_indices{$x})) { + if(!exists $file_warn_indices{$x}) { $file_warn_indices{$x} = $x; } } @@ -147,6 +170,12 @@ if(exists $options{f}) { #} } +# Parse list of warning strings for files to expand warnings +if(exists $options{S}) { + @file_match_strings = split /,/, $options{S}; +# print @file_match_strings; +} + PARSE_LINES: while (<>) { my $name; @@ -164,8 +193,8 @@ while (<>) { ($last_fort_line, $toss) = split /\./, $last_fort_line; } - # Retain last C compile line, which possibly comes a few lines before warning - if($_ =~ /.*[A-Za-z0-9_]\.c:.*/) { + # Retain last C/C++ compile line, which possibly comes a few lines before warning + if($_ =~ /.*[A-Za-z0-9_]\.[cC]:.*/) { ($last_c_name, $toss) = split /\:/, $_; } @@ -175,6 +204,9 @@ while (<>) { # Skip warnings from linker next if $_ =~ /ld: warning:/; + # Skip warnings from build_py and install_lib + next if $_ =~ /warning: (build_py|install_lib)/; + # "Hide" the C++ '::' symbol until we've parsed out the parts of the line while($_ =~ /\:\:/) { $_ =~ s/\:\:/@@@@/g; @@ -185,6 +217,11 @@ while (<>) { $name = $last_c_name; $line = "??"; ($toss, $toss, $warning, $extra, $extra2) = split /\:/, $_; + # Check for CMAKE build with warning on first line and no filename + } elsif($_ =~ /^\s*[Ww]arning:.*/) { + $name = $last_c_name; + $line = "??"; + ($toss, $warning, $extra, $extra2) = split /\:/, $_; # Check for FORTRAN warning output } elsif($_ =~ /^Warning:.*/) { $name = $last_fort_name; @@ -287,8 +324,8 @@ while (<>) { next if $_ =~ /\(this will be reported only once per input file\)/; # Eliminate "{aka }" and "{aka ''}" info - if($warning =~ /\s\{aka '?[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*'?/) { - $warning =~ s/\s\{aka '?[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*'?\}//g; + if($warning =~ /\s(\{|\()aka '?[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\[\]\ ]*'?(\}|\))/) { + $warning =~ s/\s(\{|\()aka '?[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\[\]\ ]*'?(\}|\))//g; } # print "warning = $warning\n"; @@ -297,6 +334,8 @@ while (<>) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /unused variable '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + } elsif($warning =~ /unused function '[A-Za-z_0-9]*'.*/) { + $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /implicit conversion from '[A-Za-z_0-9]*' to '[A-Za-z_0-9]*' when passing argument to function.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /implicit conversion from '[A-Za-z_0-9]*' to '[A-Za-z_0-9]*' to match other operand of binary expression.*/) { @@ -361,15 +400,21 @@ while (<>) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /Unused dummy argument '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + $warning =~ s/\([0-9]+\)/\(-\)/g; } elsif($warning =~ /Unused parameter '[A-Za-z_0-9]*' declared at.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + $warning =~ s/\([0-9]+\)/\(-\)/g; } elsif($warning =~ /Unused variable '[A-Za-z_0-9]*' declared at.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /Inequality comparison for REAL\([0-9]*\) at.*/) { $warning =~ s/REAL\([0-9]*\)/REAL\(-\)/g; + $warning =~ s/\([0-9]+\)/\(-\)/g; } elsif($warning =~ /Possible change of value in conversion from INTEGER\([0-9]*\) to (INTEGER|REAL)\([0-9]*\) at.*/) { $warning =~ s/INTEGER\([0-9]*\)/INTEGER\(-\)/g; $warning =~ s/REAL\([0-9]*\)/REAL\(-\)/g; + } elsif($warning =~ /Equality comparison for REAL\([0-9]*\) at.*/) { + $warning =~ s/REAL\([0-9]*\)/REAL\(-\)/g; + $warning =~ s/\([0-9]+\)/\(-\)/g; } elsif($warning =~ /passing argument [0-9]* of '[A-Za-z_0-9]*' with different width due to prototype.*/) { $warning =~ s/passing argument [0-9]*/passing argument -/g; $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; @@ -394,8 +439,8 @@ while (<>) { $warning =~ s/'[a-z][a-z_,\s\*\(\)]*'/'-'/g; } elsif($warning =~ /implicit declaration of function '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /'[A-Za-z_\.\[\]0-9]*' may be used uninitialized in this function.*/) { - $warning =~ s/'[A-Za-z_\.\[\]0-9]*'/'-'/g; + } elsif($warning =~ /'[A-Za-z_\.\[\]\(\)\*\&\+0-9]+[A-Za-z_\.\[\]\(\)\*\&\+0-9\ ]*' may be used uninitialized in this function.*/) { + $warning =~ s/'[A-Za-z_\.\[\]\(\)\*\&\+0-9]+[A-Za-z_\.\[\]\(\)\*\&\+0-9\ ]*'/'-'/g; } elsif($warning =~ /redundant redeclaration of '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /declaration of '[A-Za-z_0-9]*' shadows a parameter.*/) { @@ -411,6 +456,8 @@ while (<>) { } elsif($warning =~ /enum conversion when passing argument [0-9]* of '[A-Za-z_0-9]*' is invalid.*/) { $warning =~ s/passing argument [0-9]*/passing argument -/g; $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + } elsif($warning =~ /enum conversion from '[A-Za-z_0-9]*' to '[A-Za-z_0-9]*' in assignment is invalid in C\+\+.*/) { + $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /duplicate declaration of '[A-Za-z_0-9]*' is invalid in.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; } elsif($warning =~ /Variable '[A-Za-z_0-9]*' at \([0-9]*\) is a dummy argument of the BIND\(C\) procedure '[A-Za-z_0-9]*' but may not be C interoperable.*/) { @@ -422,64 +469,142 @@ while (<>) { } elsif($warning =~ /Component '[A-Za-z_0-9]*' in derived type '[A-Za-z_0-9]*' at \([0-9]*\) may not be C interoperable, even though derived type '[A-Za-z_0-9]*' is BIND\(C\).*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; $warning =~ s/at \([0-9]*\)/at \(-\)/g; - } elsif($warning =~ /function might be candidate for attribute '[A-Za-z_0-9]*' if it is known to return normally \[-Wsuggest-attribute=[A-Za-z_0-9]*\].*/) { + } elsif($warning =~ /function might be candidate for attribute '[A-Za-z_0-9]*' if it is known to return normally.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; $warning =~ s/=[A-Za-z_0-9]*\]/=-\]/g; - } elsif($warning =~ /function might be candidate for attribute '[A-Za-z_0-9]*' \[-Wsuggest-attribute=[A-Za-z_0-9]*\].*/) { + } elsif($warning =~ /function might be candidate for attribute '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; $warning =~ s/=[A-Za-z_0-9]*\]/=-\]/g; - } elsif($warning =~ /passing argument [0-9]+ of '[A-Za-z_0-9]*' makes integer from pointer without a cast \[-Wint-conversion\].*/) { + } elsif($warning =~ /passing argument [0-9]+ of '[A-Za-z_0-9]*' makes integer from pointer without a cast.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; $warning =~ s/[0-9]+/-/g; - } elsif($warning =~ /function '[A-Za-z_0-9]*' might be a candidate for '[A-Za-z_0-9]*' format attribute \[-Wsuggest-attribute=format\].*/) { + } elsif($warning =~ /function '[A-Za-z_0-9]*' might be a candidate for '[A-Za-z_0-9]*' format attribute.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /inlining failed in call to '[A-Za-z_0-9]*': call is unlikely and code size would grow \[-Winline\].*/) { + } elsif($warning =~ /inlining failed in call to '[A-Za-z_0-9]*': call is unlikely and code size would grow.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /'%[0-9]*[\.\*]*[0-9]*[L]*[dfsu]' directive writing (between [0-9]+ and [0-9]+)|(up to [0-9]+) bytes into a region of size (between [0-9]+ and [0-9]+)|([0-9]+) \[-Wformat-overflow=\].*/) { - $warning =~ s/'%[0-9]*[\.\*]*[0-9]*[L]*[dfsu]'/'-'/g; + } elsif($warning =~ /'%[0-9]*[\.\*]*[0-9]*L*[dfsu]' directive writing ((between [0-9]+ and [0-9]+)|(up to [0-9]+)) bytes into a region of size ((between [0-9]+ and [0-9]+)|([0-9]+)).*/) { + $warning =~ s/'%[0-9]*[\.\*]*[0-9]*L*[dfsu]'/'-'/g; $warning =~ s/[0-9]+/-/g; - } elsif($warning =~ /'(%[0-9]*[\.\*]*[0-9]*[dfsu])|([A-Za-z_0-9\/]+)' directive output may be truncated writing (between [0-9]+ and [0-9]+)|(up to [0-9]+)|(likely 1 or more) byte(s)? into a region of size (between [0-9]+ and [0-9]+)|([0-9]+) \[-Wformat-truncation=\].*/) { + } elsif($warning =~ /'((%[0-9]*[\.\*]*[0-9]*[dfsu])|([A-Za-z_0-9\/]+))' directive output may be truncated writing ((between [0-9]+ and [0-9]+)|(up to [0-9]+)|([0-9+)|(likely 1 or more)) byte(s)? into a region of size ((between [0-9]+ and [0-9]+)|([0-9]+)).*/) { $warning =~ s/'%[0-9]*[\.\*]*[0-9]*[dfsu]'/'-'/g; $warning =~ s/'[A-Za-z_0-9\/]+'/'-'/g; $warning =~ s/[0-9]+/-/g; - } elsif($warning =~ /conversion to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' may change the sign of the result \[-Wsign-conversion\].*/) { + } elsif($warning =~ /'%[0-9]*[\.\*]*[0-9]*[dfsu]' directive argument is null.*/) { + $warning =~ s/'%[0-9]*[\.\*]*[0-9]*[dfsu]'/'-'/g; + } elsif($warning =~ /conversion to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' may change the sign of the result.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'/'-'/g; - } elsif($warning =~ /unsigned conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' changes value from '-?[0-9]+' to '[0-9]+' \[-Wsign-conversion\].*/) { + } elsif($warning =~ /unsigned conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' changes value from '-?[0-9]+' to '[0-9]+'.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'/'-'/g; $warning =~ s/'-?[0-9]+'/'-'/g; - } elsif($warning =~ /conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' may change value \[-Wconversion\].*/) { + } elsif($warning =~ /conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' may change value.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'/'-'/g; - } elsif($warning =~ /overflow in conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' changes value from '-?[0-9]+' to '-?[0-9]+' \[-Woverflow\].*/) { + } elsif($warning =~ /overflow in conversion from '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' changes value from '-?[0-9]+' to '-?[0-9]+'.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'/'-'/g; $warning =~ s/'-?[0-9]+'/'-'/g; - } elsif($warning =~ /cast between incompatible function types from '[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*' \[-Wcast-function-type\].*/) { + } elsif($warning =~ /cast between incompatible function types from '[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*' to '[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*'.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\(\)\*\,\ ]*'/'-'/g; - } elsif($warning =~ /(return|initialization|assignment) discards '[A-Za-z_0-9]*' qualifier from pointer target type \[-Wdiscarded-qualifiers\].*/) { + } elsif($warning =~ /(return|initialization|assignment) discards '[A-Za-z_0-9]*' qualifier from pointer target type.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /'[A-Za-z_0-9]*' attribute on function returning '[A-Za-z_0-9]*' \[-Wattributes\].*/) { + } elsif($warning =~ /'[A-Za-z_0-9]*' attribute on function returning '[A-Za-z_0-9]*'.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /ignoring return value of '[A-Za-z_0-9]*', declared with attribute warn_unused_result \[-Wunused-result\].*/) { + } elsif($warning =~ /ignoring return value of '[A-Za-z_0-9]*', declared with attribute warn_unused_result.*/) { $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; - } elsif($warning =~ /passing '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' chooses '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' over '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' \[-Wsign-promo\].*/) { + } elsif($warning =~ /passing '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' chooses '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*' over '[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'.*/) { $warning =~ s/'[A-Za-z_0-9]+[A-Za-z_0-9\ ]*'/'-'/g; - } elsif($warning =~ /'[A-Za-z_\:0-9]+[A-Za-z_\:0-9\ ]*' should be initialized in the member initialization list \[-Weffc\+\+\].*/) { + } elsif($warning =~ /'[A-Za-z_\:0-9]+[A-Za-z_\:0-9\ ]*' should be initialized in the member initialization list.*/) { $warning =~ s/'[A-Za-z_\:0-9]+[A-Za-z_\:0-9\ ]*'/'-'/g; } elsif($warning =~ /\[deprecation\] [A-Za-z_0-9]*\([A-Za-z_,0-9]*\) in [A-Za-z_0-9]* has been deprecated.*/) { $warning =~ s/[A-Za-z_0-9]*\([A-Za-z_,0-9]*\) in [A-Za-z_0-9]*/-\(-\) in -/g; + } elsif($warning =~ /size of '[A-Za-z_\*0-9]*' [0-9]+ bytes exceeds maximum object size [0-9]+ .*/) { + $warning =~ s/'[A-Za-z_\*0-9]*'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /'[A-Za-z_0-9]*' output truncated before terminating nul copying [0-9]+ bytes from a string of the same length.*/) { + $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /assignment to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' makes pointer from integer without a cast.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /assignment to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' makes integer from pointer without a cast.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /assignment to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from incompatible pointer type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /ignoring attribute '[a-z]*' because it conflicts with attribute '[a-z]*'.*/) { + $warning =~ s/'[a-z]*'/'-'/g; + } elsif($warning =~ /passing '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' to parameter of type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' discards qualifiers.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /assigning to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' discards qualifiers.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /unknown warning group '[A-Za-z-=]*', ignored.*/) { + $warning =~ s/'[A-Za-z-=]*'/'-'/g; + } elsif($warning =~ /'[A-Za-z_0-9]*' macro redefined.*/) { + $warning =~ s/'[A-Za-z_0-9]*'/'-'/g; + } elsif($warning =~ /"[A-Za-z_0-9]*" redefined.*/) { + $warning =~ s/"[A-Za-z_0-9]*"/"-"/g; + } elsif($warning =~ /incompatible (pointer|integer) to (pointer|integer) conversion assigning to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /returning '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' from a function with result type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' discards qualifiers.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /array index [0-9]+ is past the end of the array \(which contains [0-9]+ elements\).*/) { + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /array subscript [0-9]+ is above array bounds of '[A-Za-z_\*\.0-9]+[A-Za-z_\*\.\[\]0-9\ ]*'.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*\.\[\]0-9\ ]*'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /expression which evaluates to zero treated as a null pointer constant of type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /result of comparison of constant [0-9]+ with expression of type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' is always (true|false).*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /initializing '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' with an expression of type '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' discards qualifiers.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + } elsif($warning =~ /implicit conversion from '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' to '[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*' changes value from -?[0-9]+ to -?[0-9]+.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*0-9\ ]*'/'-'/g; + $warning =~ s/-?[0-9]+/-/g; + } elsif($warning =~ /passing '[A-Za-z_\*0-9]+[A-Za-z_\*\[\]0-9\ ]*' to parameter of type '[A-Za-z_\*0-9]+[A-Za-z_\*\[\]0-9\ ]*' converts between pointers to integer types with different sign.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*\[\]0-9\ ]*'/'-'/g; + } elsif($warning =~ /address of '[A-Za-z_\*\.0-9]+[A-Za-z_\*\.0-9\ ]*' will always evaluate to 'true'.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*\.0-9\ ]*'/'-'/g; + } elsif($warning =~ /length modifier '[A-Za-z]' results in undefined behavior or no effect with '[A-Za-z]' conversion specifier.*/) { + $warning =~ s/'[A-Za-z]'/'-'/g; + } elsif($warning =~ /'[A-Za-z_]+' specified bound depends on the length of the source argument.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + } elsif($warning =~ /'[A-Za-z_]+' specified bound [0-9]+ equals destination size.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /'[A-Za-z_]+' output may be truncated copying between [0-9]+ and [0-9]+ bytes from a string of length [0-9]+.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + $warning =~ s/[0-9]+/-/g; + } elsif($warning =~ /'[A-Za-z_]+' output may be truncated before the last format character.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + } elsif($warning =~ /'[A-Za-z_]+' output truncated before terminating nul copying as many bytes from a string as its length.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + } elsif($warning =~ /'[A-Za-z_\:0-9]+' hides overloaded virtual function.*/) { + $warning =~ s/'[A-Za-z_\:0-9]+'/'-'/g; + } elsif($warning =~ /'[A-Za-z_]+' storage class specifier is deprecated and incompatible with C\+\+1z.*/) { + $warning =~ s/'[A-Za-z_]+'/'-'/g; + } elsif($warning =~ /explicitly assigning value of variable of type '[A-Za-z_\*\.0-9]+[A-Za-z_\*\.0-9\ ]*' to itself.*/) { + $warning =~ s/'[A-Za-z_\*0-9]+[A-Za-z_\*\.0-9\ ]*'/'-'/g; + } elsif($warning =~ /private field '[A-Za-z_0-9]+' is not used.*/) { + $warning =~ s/'[A-Za-z_0-9]+'/'-'/g; + } elsif($warning =~ /field '[A-Za-z_0-9]+' will be initialized after field '[A-Za-z_0-9]+'.*/) { + $warning =~ s/'[A-Za-z_0-9]+'/'-'/g; } +# print "warning = $warning\n"; - # Increment count for [generic] warning - $warn_count{$warning}++; - $warn_file{$warning}{$name}++; - push(@{ $warn_file_line{$warning}{$name} }, $line); - - # Increment count for filename - $file_count{$name}++; - $file_warn{$name}{$warning}++; - push(@{ $file_warn_line{$name}{$warning} }, $line); - - # Increment total count of warnings - $totalcount++; + # Check if we've already seen this warning on this line in this file + # (Can happen for warnings from inside header files) + if( !exists $warn_file_line{$warning}{$name}{$line} ) { + # Increment count for [generic] warning + $warn_count{$warning}++; + $warn_file{$warning}{$name}++; + $warn_file_line{$warning}{$name}{$line}++; + + # Increment count for filename + $file_count{$name}++; + $file_warn{$name}{$warning}++; + $file_warn_line{$name}{$warning}{$line}++; + + # Increment total count of warnings + $totalcount++; + } # print "name = $name\n"; # print "line = $line\n"; @@ -487,7 +612,7 @@ while (<>) { # print "warning = \"$warning\"\n"; } -print "Total [non-ignored] warnings: $totalcount\n"; +print "Total unique [non-ignored] warnings: $totalcount\n"; print "Total ignored warnings: $ignorecount\n"; $warncount = keys %warn_count; print "Total unique kinds of warnings: $warncount\n"; @@ -499,18 +624,33 @@ print "# of Warnings by frequency (file count)\n"; print "=======================================\n"; for my $x (sort {$warn_count{$b} <=> $warn_count{$a}} keys(%warn_count)) { printf ("[%2d] %4d (%2d) - %s\n", $current_warning++, $warn_count{$x}, scalar(keys %{$warn_file_line{$x}}), $x); - if((exists $options{W}) || (exists $options{w})) { + if((exists $options{W}) || (exists $options{w}) || (exists $options{s})) { my $curr_index = $current_warning - 1; - + my $match = 0; + + # Check for string from list in current warning + if(exists $options{s}) { + for my $y (@warn_match_strings) { +# print "y = '$y'\n"; + if($x =~ /$y/) { +# print "matched warning = '$x'\n"; + $match = 1; + last; + } + } + } + + # Check if current warning index matches if((exists $warn_file_indices{$curr_index}) && $curr_index == $warn_file_indices{$curr_index}) { + $match = 1; + } + + if($match) { for my $y (sort {$warn_file{$x}{$b} <=> $warn_file{$x}{$a}} keys(%{$warn_file{$x}})) { printf ("\t%4d - %s\n", $warn_file{$x}{$y}, $y); if(exists $options{l}) { - printf ("\t\tLines: "); - for my $z ( @{ $warn_file_line{$x}{$y} } ) { - printf ("%s, ", $z); - } - printf("\n"); + my $lines = join ", ", sort {$a <=> $b} keys $warn_file_line{$x}{$y}; + printf("\t\tLines: $lines \n"); } } } @@ -524,16 +664,31 @@ for my $x (sort {$file_count{$b} <=> $file_count{$a}} keys(%file_count)) { printf ("[%3d] %4d (%2d) - %s\n", $current_file++, $file_count{$x}, scalar(keys %{$file_warn_line{$x}}), $x); if((exists $options{F}) || (exists $options{f})) { my $curr_index = $current_file - 1; - + my $match = 0; + + # Check for string from list in current file + if(exists $options{S}) { + for my $y (@file_match_strings) { +# print "y = '$y'\n"; + if($x =~ /$y/) { +# print "matched warning = '$x'\n"; + $match = 1; + last; + } + } + } + + # Check if current file index matches if((exists $file_warn_indices{$curr_index}) && $curr_index == $file_warn_indices{$curr_index}) { + $match = 1; + } + + if($match) { for my $y (sort {$file_warn{$x}{$b} <=> $file_warn{$x}{$a}} keys(%{$file_warn{$x}})) { printf ("\t%4d - %s\n", $file_warn{$x}{$y}, $y); if(exists $options{l}) { - printf ("\t\tLines: "); - for my $z ( @{ $file_warn_line{$x}{$y} } ) { - printf ("%s, ", $z); - } - printf("\n"); + my $lines = join ", ", sort {$a <=> $b} keys $file_warn_line{$x}{$y}; + printf("\t\tLines: $lines \n"); } } } diff --git a/config/gnu-flags b/config/gnu-flags index fc3a6ce..c5c70eb 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -113,14 +113,15 @@ case "$cc_vendor-$cc_version" in # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it from the # environment variable at configure time. + # # NOTE: Disable the -Wformat-nonliteral from -Wformat=2 here and re-add # it to the developer flags. + # H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" - H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" + H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked" H5_CFLAGS="$H5_CFLAGS -Wredundant-decls -Wshadow -Wstrict-prototypes -Wswitch-enum -Wswitch-default" - # As of GCC 8.x, the -Wunsafe-loop-optimizations has been removed H5_CFLAGS="$H5_CFLAGS -Wundef -Wunused-macros -Wunsafe-loop-optimizations -Wwrite-strings" # Production @@ -191,10 +192,60 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in -# When the gcc 9.x release is out, we should check for additional flags to +# When the gcc 10.x release is out, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-[89].*) + gcc-9*) + # Append warning flags that only gcc 4.2+ knows about + # (none, or incorporated in -Wall / -Wextra now) + + # Append warning flags that only gcc 4.3+ knows about + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" + + # Append warning flags that only gcc 4.4+ knows about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append warning flags that only gcc 4.5+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append warning flags that only gcc 4.6+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wtrampolines" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=const" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=const" + + # Append warning flags that only gcc 4.7+ knows about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=pure -Wsuggest-attribute=noreturn" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=pure -Wno-suggest-attribute=noreturn" + + # Append warning flags that only gcc 4.8+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wsuggest-attribute=format" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=format" + + # Append warning flags that only gcc 4.9+ knows about + H5_CFLAGS="$H5_CFLAGS -Wdate-time" + + # Append warning flags that only gcc 5.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Warray-bounds=2 -Wc99-c11-compat" + + # Append warning flags that only gcc 6.x+ knows about + H5_CFLAGS="$H5_CFLAGS -Wnull-dereference -Wunused-const-variable -Wduplicated-cond -Whsa -Wnormalized" + + # Append warning flags that only gcc 7.x+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=2" + H5_CFLAGS="$H5_CFLAGS -Walloc-zero -Walloca -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wimplicit-fallthrough=5 -Wrestrict" + + # Append warning flags that only gcc 8.x+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=malloc" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc" + H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2" + + # Append warning flags that only gcc 9.x+ knows about + DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS " + H5_CFLAGS="$H5_CFLAGS -Wattribute-alias=2 -Wmissing-profile" + ;; + + gcc-8*) # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) @@ -202,7 +253,7 @@ case "$cc_vendor-$cc_version" in # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560 -Wvla" + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" @@ -239,10 +290,10 @@ case "$cc_vendor-$cc_version" in # Append warning flags that only gcc 8.x+ knows about DEVELOPER_WARNING_CFLAGS="$DEVELOPER_WARNING_CFLAGS -Wstringop-overflow=4 -Wsuggest-attribute=cold -Wsuggest-attribute=malloc" - H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2 -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc" + NO_DEVELOPER_WARNING_CFLAGS="$NO_DEVELOPER_WARNING_CFLAGS -Wno-suggest-attribute=cold -Wno-suggest-attribute=malloc" + H5_CFLAGS="$H5_CFLAGS -Wattribute-alias -Wcast-align=strict -Wshift-overflow=2" ;; - gcc-7*) # Append warning flags that only gcc 4.2+ knows about # (none, or incorporated in -Wall / -Wextra now) @@ -251,7 +302,7 @@ case "$cc_vendor-$cc_version" in # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560 -Wvla" + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" @@ -295,7 +346,7 @@ case "$cc_vendor-$cc_version" in # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560 -Wvla" + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" @@ -335,7 +386,7 @@ case "$cc_vendor-$cc_version" in # # Technically, variable-length arrays are part of the C99 standard, but # we should approach them a bit cautiously... -QAK - H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560 -Wvla" + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2560" # Append warning flags that only gcc 4.4+ knows about H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index b6a7f58..2219263 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,4 +1,4 @@ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" #pragma GCC diagnostic ignored "-Wlarger-than=" @@ -50,7 +50,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 39 +#define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -88,6 +88,7 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; @@ -95,6 +96,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -125,8 +127,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -183,15 +183,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -217,7 +209,6 @@ extern FILE *H5LTyyin, *H5LTyyout; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -406,7 +397,7 @@ static void yy_fatal_error (yyconst char msg[] ); */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ - H5LTyyleng = (size_t) (yy_cp - yy_bp); \ + H5LTyyleng = (yy_size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; @@ -893,15 +884,16 @@ char *H5LTyytext; * If you make any changes to H5LTanalyze.l, please run bin/genparser to * recreate the output files. */ -#line 23 "hl/src/H5LTanalyze.l" +#line 21 "hl/src/H5LTanalyze.l" #include #include #include #include "H5LTparse.h" -/* Turn off suggest const attribute warning in gcc */ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" #endif int my_yyinput(char *, int); @@ -952,7 +944,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 936 "hl/src/H5LTanalyze.c" +#line 926 "hl/src/H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1026,12 +1018,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1039,7 +1026,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout )) {} } while (0) +#define ECHO fwrite( H5LTyytext, H5LTyyleng, 1, H5LTyyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1050,7 +1037,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( H5LTyyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1132,6 +1119,11 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; +#line 83 "hl/src/H5LTanalyze.l" + + +#line 1104 "hl/src/H5LTanalyze.c" + if ( !(yy_init) ) { (yy_init) = 1; @@ -1164,12 +1156,6 @@ YY_DECL H5LTyy_load_buffer_state( ); } - { -#line 84 "hl/src/H5LTanalyze.l" - - -#line 1152 "hl/src/H5LTanalyze.c" - while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -1190,7 +1176,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; @@ -1206,6 +1192,7 @@ yy_match: yy_find_action: yy_current_state = *--(yy_state_ptr); (yy_lp) = yy_accept[yy_current_state]; +goto find_rule; /* Shut up GCC warning -Wall */ find_rule: /* we branch to this label when backing up */ for ( ; ; ) /* until we find what rule we matched */ { @@ -1230,277 +1217,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 86 "hl/src/H5LTanalyze.l" +#line 85 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 87 "hl/src/H5LTanalyze.l" +#line 86 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 88 "hl/src/H5LTanalyze.l" +#line 87 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 89 "hl/src/H5LTanalyze.l" +#line 88 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 90 "hl/src/H5LTanalyze.l" +#line 89 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 91 "hl/src/H5LTanalyze.l" +#line 90 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 92 "hl/src/H5LTanalyze.l" +#line 91 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 93 "hl/src/H5LTanalyze.l" +#line 92 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 95 "hl/src/H5LTanalyze.l" +#line 94 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 96 "hl/src/H5LTanalyze.l" +#line 95 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 97 "hl/src/H5LTanalyze.l" +#line 96 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 98 "hl/src/H5LTanalyze.l" +#line 97 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 99 "hl/src/H5LTanalyze.l" +#line 98 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 100 "hl/src/H5LTanalyze.l" +#line 99 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 101 "hl/src/H5LTanalyze.l" +#line 100 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 102 "hl/src/H5LTanalyze.l" +#line 101 "hl/src/H5LTanalyze.l" {return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 104 "hl/src/H5LTanalyze.l" +#line 103 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 105 "hl/src/H5LTanalyze.l" +#line 104 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 106 "hl/src/H5LTanalyze.l" +#line 105 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 107 "hl/src/H5LTanalyze.l" +#line 106 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 108 "hl/src/H5LTanalyze.l" +#line 107 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 109 "hl/src/H5LTanalyze.l" +#line 108 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 110 "hl/src/H5LTanalyze.l" +#line 109 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 111 "hl/src/H5LTanalyze.l" +#line 110 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 112 "hl/src/H5LTanalyze.l" +#line 111 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 113 "hl/src/H5LTanalyze.l" +#line 112 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 114 "hl/src/H5LTanalyze.l" +#line 113 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 116 "hl/src/H5LTanalyze.l" +#line 115 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 117 "hl/src/H5LTanalyze.l" +#line 116 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 118 "hl/src/H5LTanalyze.l" +#line 117 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 119 "hl/src/H5LTanalyze.l" +#line 118 "hl/src/H5LTanalyze.l" {return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 120 "hl/src/H5LTanalyze.l" +#line 119 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 121 "hl/src/H5LTanalyze.l" +#line 120 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 122 "hl/src/H5LTanalyze.l" +#line 121 "hl/src/H5LTanalyze.l" {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 124 "hl/src/H5LTanalyze.l" +#line 123 "hl/src/H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 125 "hl/src/H5LTanalyze.l" +#line 124 "hl/src/H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 126 "hl/src/H5LTanalyze.l" +#line 125 "hl/src/H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 127 "hl/src/H5LTanalyze.l" +#line 126 "hl/src/H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 128 "hl/src/H5LTanalyze.l" +#line 127 "hl/src/H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 129 "hl/src/H5LTanalyze.l" +#line 128 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 130 "hl/src/H5LTanalyze.l" +#line 129 "hl/src/H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 131 "hl/src/H5LTanalyze.l" +#line 130 "hl/src/H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 132 "hl/src/H5LTanalyze.l" +#line 131 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 133 "hl/src/H5LTanalyze.l" +#line 132 "hl/src/H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 134 "hl/src/H5LTanalyze.l" +#line 133 "hl/src/H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 135 "hl/src/H5LTanalyze.l" +#line 134 "hl/src/H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 136 "hl/src/H5LTanalyze.l" +#line 135 "hl/src/H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 138 "hl/src/H5LTanalyze.l" +#line 137 "hl/src/H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 139 "hl/src/H5LTanalyze.l" +#line 138 "hl/src/H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 140 "hl/src/H5LTanalyze.l" +#line 139 "hl/src/H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 141 "hl/src/H5LTanalyze.l" +#line 140 "hl/src/H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 143 "hl/src/H5LTanalyze.l" +#line 142 "hl/src/H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 144 "hl/src/H5LTanalyze.l" +#line 143 "hl/src/H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 145 "hl/src/H5LTanalyze.l" +#line 144 "hl/src/H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 147 "hl/src/H5LTanalyze.l" +#line 146 "hl/src/H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1513,7 +1500,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 157 "hl/src/H5LTanalyze.l" +#line 156 "hl/src/H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1528,7 +1515,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 167 "hl/src/H5LTanalyze.l" +#line 166 "hl/src/H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1541,52 +1528,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 177 "hl/src/H5LTanalyze.l" +#line 176 "hl/src/H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 178 "hl/src/H5LTanalyze.l" +#line 177 "hl/src/H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 179 "hl/src/H5LTanalyze.l" +#line 178 "hl/src/H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 180 "hl/src/H5LTanalyze.l" +#line 179 "hl/src/H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 181 "hl/src/H5LTanalyze.l" +#line 180 "hl/src/H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 182 "hl/src/H5LTanalyze.l" +#line 181 "hl/src/H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 183 "hl/src/H5LTanalyze.l" +#line 182 "hl/src/H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 184 "hl/src/H5LTanalyze.l" +#line 183 "hl/src/H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 186 "hl/src/H5LTanalyze.l" +#line 185 "hl/src/H5LTanalyze.l" ECHO; YY_BREAK -#line 1570 "hl/src/H5LTanalyze.c" +#line 1555 "hl/src/H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -1718,7 +1705,6 @@ ECHO; "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of user's declarations */ } /* end of H5LTyylex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1880,7 +1866,7 @@ static int yy_get_next_buffer (void) if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1968,7 +1954,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( H5LTyywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -2104,6 +2090,10 @@ static void H5LTyy_load_buffer_state (void) H5LTyyfree((void *) b ); } +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a H5LTyyrestart() or at EOF. @@ -2308,8 +2298,8 @@ YY_BUFFER_STATE H5LTyy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to H5LTyylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2317,8 +2307,7 @@ YY_BUFFER_STATE H5LTyy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_ { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - yy_size_t i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index b9b492e..f16455b 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -23,9 +23,10 @@ #include #include "H5LTparse.h" -/* Turn off suggest const attribute warning in gcc */ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +/* Turn off suggest const & malloc attribute warnings in gcc */ +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wsuggest-attribute=const" +#pragma GCC diagnostic ignored "-Wsuggest-attribute=malloc" #endif int my_yyinput(char *, int); diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 5835dcc..193ba1f 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,4 +1,4 @@ -#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ #pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" #pragma GCC diagnostic ignored "-Wlarger-than=" @@ -20,11 +20,12 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.4.1. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,11 +63,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -91,8 +95,8 @@ #define yylval H5LTyylval #define yychar H5LTyychar -/* Copy the first part of user declarations. */ -#line 22 "hl/src/H5LTparse.y" /* yacc.c:339 */ +/* First part of user prologue. */ +#line 20 "hl/src/H5LTparse.y" #include #include @@ -145,13 +149,17 @@ hbool_t is_opq_size = 0; /*flag to lexer for opaque type size*/ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ -#line 127 "hl/src/H5LTparse.c" /* yacc.c:339 */ +#line 131 "hl/src/H5LTparse.c" # ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULLPTR 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -163,8 +171,8 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ # define YYERROR_VERBOSE 0 #endif -/* In a future release of Bison, this section will be replaced - by #include "H5LTparse.h". */ +/* Use api.header.include to #include this header + instead of duplicating it here. */ #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED /* Debug traces. */ @@ -241,17 +249,18 @@ extern int H5LTyydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 74 "hl/src/H5LTparse.y" /* yacc.c:355 */ +#line 72 "hl/src/H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ -#line 232 "hl/src/H5LTparse.c" /* yacc.c:355 */ +#line 239 "hl/src/H5LTparse.c" + }; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif @@ -263,9 +272,7 @@ hid_t H5LTyyparse (void); #endif /* !YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED */ -/* Copy the second part of user declarations. */ -#line 247 "hl/src/H5LTparse.c" /* yacc.c:358 */ #ifdef short # undef short @@ -286,13 +293,13 @@ typedef signed char yytype_int8; #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif #ifndef YYSIZE_T @@ -304,7 +311,7 @@ typedef short int yytype_int16; # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif @@ -340,15 +347,6 @@ typedef short int yytype_int16; # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -356,7 +354,7 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -376,6 +374,8 @@ typedef short int yytype_int16; #endif +#define YY_ASSERT(E) ((void) (0 && (E))) + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -518,16 +518,16 @@ union yyalloc /* YYNSTATES -- Number of states. */ #define YYNSTATES 143 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 313 +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -568,16 +568,16 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 107, 107, 108, 110, 111, 112, 113, 115, 116, - 117, 118, 119, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 151, 152, 153, 154, 155, 156, 157, 161, 160, 169, - 170, 172, 172, 209, 217, 218, 221, 223, 223, 232, - 233, 235, 236, 235, 243, 246, 252, 253, 258, 259, - 250, 267, 269, 273, 274, 282, 291, 298, 271, 322, - 323, 325, 326, 327, 329, 330, 332, 333, 337, 336, - 341, 342, 344, 344, 398, 400 + 0, 105, 105, 106, 108, 109, 110, 111, 113, 114, + 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 149, 150, 151, 152, 153, 154, 155, 159, 158, 167, + 168, 170, 170, 207, 215, 216, 219, 221, 221, 230, + 231, 233, 234, 233, 241, 244, 250, 251, 256, 257, + 248, 265, 267, 271, 272, 280, 289, 296, 269, 320, + 321, 323, 324, 325, 327, 328, 330, 331, 335, 334, + 339, 340, 342, 342, 396, 398 }; #endif @@ -823,22 +823,22 @@ static const yytype_uint8 yyr2[] = #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Error token number */ #define YYTERROR 1 @@ -878,37 +878,37 @@ do { \ } while (0) -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -942,7 +942,7 @@ do { \ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -953,7 +953,7 @@ yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } @@ -1057,7 +1057,10 @@ yytnamerr (char *yyres, const char *yystr) case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1075,7 +1078,7 @@ yytnamerr (char *yyres, const char *yystr) if (! yyres) return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif @@ -1153,10 +1156,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1168,6 +1171,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -1179,9 +1183,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } if (*yymsg_alloc < yysize) @@ -1307,23 +1312,33 @@ yyparse (void) yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; + +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); -#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1339,14 +1354,10 @@ yyparse (void) &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1362,35 +1373,33 @@ yyparse (void) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1448,7 +1457,6 @@ yybackup: YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; @@ -1463,7 +1471,7 @@ yydefault: /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1483,246 +1491,246 @@ yyreduce: YY_REDUCE_PRINT (yyn); switch (yyn) { - case 2: -#line 107 "hl/src/H5LTparse.y" /* yacc.c:1646 */ + case 2: +#line 105 "hl/src/H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } -#line 1468 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1476 "hl/src/H5LTparse.c" break; case 3: -#line 108 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 106 "hl/src/H5LTparse.y" { return (yyval.hid);} -#line 1474 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1482 "hl/src/H5LTparse.c" break; case 13: -#line 122 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 120 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } -#line 1480 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1488 "hl/src/H5LTparse.c" break; case 14: -#line 123 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 121 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } -#line 1486 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1494 "hl/src/H5LTparse.c" break; case 15: -#line 124 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 122 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } -#line 1492 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1500 "hl/src/H5LTparse.c" break; case 16: -#line 125 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 123 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } -#line 1498 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1506 "hl/src/H5LTparse.c" break; case 17: -#line 126 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 124 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } -#line 1504 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1512 "hl/src/H5LTparse.c" break; case 18: -#line 127 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 125 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } -#line 1510 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1518 "hl/src/H5LTparse.c" break; case 19: -#line 128 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 126 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } -#line 1516 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1524 "hl/src/H5LTparse.c" break; case 20: -#line 129 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 127 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } -#line 1522 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1530 "hl/src/H5LTparse.c" break; case 21: -#line 130 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 128 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } -#line 1528 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1536 "hl/src/H5LTparse.c" break; case 22: -#line 131 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 129 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } -#line 1534 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1542 "hl/src/H5LTparse.c" break; case 23: -#line 132 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 130 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } -#line 1540 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1548 "hl/src/H5LTparse.c" break; case 24: -#line 133 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 131 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } -#line 1546 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1554 "hl/src/H5LTparse.c" break; case 25: -#line 134 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 132 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } -#line 1552 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1560 "hl/src/H5LTparse.c" break; case 26: -#line 135 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 133 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } -#line 1558 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1566 "hl/src/H5LTparse.c" break; case 27: -#line 136 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 134 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } -#line 1564 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1572 "hl/src/H5LTparse.c" break; case 28: -#line 137 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 135 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } -#line 1570 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1578 "hl/src/H5LTparse.c" break; case 29: -#line 138 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 136 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } -#line 1576 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1584 "hl/src/H5LTparse.c" break; case 30: -#line 139 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 137 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } -#line 1582 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1590 "hl/src/H5LTparse.c" break; case 31: -#line 140 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 138 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } -#line 1588 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1596 "hl/src/H5LTparse.c" break; case 32: -#line 141 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 139 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } -#line 1594 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1602 "hl/src/H5LTparse.c" break; case 33: -#line 142 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 140 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } -#line 1600 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1608 "hl/src/H5LTparse.c" break; case 34: -#line 143 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 141 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } -#line 1606 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1614 "hl/src/H5LTparse.c" break; case 35: -#line 144 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 142 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } -#line 1612 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1620 "hl/src/H5LTparse.c" break; case 36: -#line 145 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 143 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } -#line 1618 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1626 "hl/src/H5LTparse.c" break; case 37: -#line 146 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 144 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } -#line 1624 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1632 "hl/src/H5LTparse.c" break; case 38: -#line 147 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 145 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } -#line 1630 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1638 "hl/src/H5LTparse.c" break; case 39: -#line 148 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 146 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } -#line 1636 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1644 "hl/src/H5LTparse.c" break; case 40: -#line 151 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 149 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } -#line 1642 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1650 "hl/src/H5LTparse.c" break; case 41: -#line 152 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 150 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } -#line 1648 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1656 "hl/src/H5LTparse.c" break; case 42: -#line 153 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 151 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } -#line 1654 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1662 "hl/src/H5LTparse.c" break; case 43: -#line 154 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 152 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } -#line 1660 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1668 "hl/src/H5LTparse.c" break; case 44: -#line 155 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 153 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } -#line 1666 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1674 "hl/src/H5LTparse.c" break; case 45: -#line 156 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 154 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } -#line 1672 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1680 "hl/src/H5LTparse.c" break; case 46: -#line 157 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 155 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } -#line 1678 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1686 "hl/src/H5LTparse.c" break; case 47: -#line 161 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 159 "hl/src/H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } -#line 1684 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1692 "hl/src/H5LTparse.c" break; case 48: -#line 163 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 161 "hl/src/H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; } -#line 1694 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1702 "hl/src/H5LTparse.c" break; case 51: -#line 172 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 170 "hl/src/H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } -#line 1700 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1708 "hl/src/H5LTparse.c" break; case 52: -#line 174 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 172 "hl/src/H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1757,117 +1765,117 @@ yyreduce: new_size = H5Tget_size(dtype_id); } -#line 1739 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1747 "hl/src/H5LTparse.c" break; case 53: -#line 210 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 208 "hl/src/H5LTparse.y" { (yyval.sval) = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } -#line 1749 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1757 "hl/src/H5LTparse.c" break; case 54: -#line 217 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 215 "hl/src/H5LTparse.y" { (yyval.ival) = 0; } -#line 1755 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1763 "hl/src/H5LTparse.c" break; case 55: -#line 219 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 217 "hl/src/H5LTparse.y" { (yyval.ival) = yylval.ival; } -#line 1761 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1769 "hl/src/H5LTparse.c" break; case 57: -#line 223 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 221 "hl/src/H5LTparse.y" { asindex++; /*pushd onto the stack*/ } -#line 1767 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1775 "hl/src/H5LTparse.c" break; case 58: -#line 225 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 223 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; H5Tclose((yyvsp[-1].hid)); } -#line 1778 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1786 "hl/src/H5LTparse.c" break; case 61: -#line 235 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 233 "hl/src/H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } -#line 1784 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1792 "hl/src/H5LTparse.c" break; case 62: -#line 236 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 234 "hl/src/H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; arr_stack[asindex].is_dim = 0; } -#line 1794 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1802 "hl/src/H5LTparse.c" break; case 65: -#line 247 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 245 "hl/src/H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1800 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1808 "hl/src/H5LTparse.c" break; case 66: -#line 252 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 250 "hl/src/H5LTparse.y" { is_opq_size = 1; } -#line 1806 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1814 "hl/src/H5LTparse.c" break; case 67: -#line 253 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 251 "hl/src/H5LTparse.y" { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); is_opq_size = 0; } -#line 1816 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1824 "hl/src/H5LTparse.c" break; case 68: -#line 258 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 256 "hl/src/H5LTparse.y" { is_opq_tag = 1; } -#line 1822 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1830 "hl/src/H5LTparse.c" break; case 69: -#line 259 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 257 "hl/src/H5LTparse.y" { H5Tset_tag((yyvsp[-6].hid), yylval.sval); free(yylval.sval); yylval.sval = NULL; is_opq_tag = 0; } -#line 1833 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1841 "hl/src/H5LTparse.c" break; case 70: -#line 265 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 263 "hl/src/H5LTparse.y" { (yyval.hid) = (yyvsp[-8].hid); } -#line 1839 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1847 "hl/src/H5LTparse.c" break; case 73: -#line 273 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 271 "hl/src/H5LTparse.y" { is_str_size = 1; } -#line 1845 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1853 "hl/src/H5LTparse.c" break; case 74: -#line 274 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 272 "hl/src/H5LTparse.y" { if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; @@ -1875,11 +1883,11 @@ yyreduce: str_size = yylval.ival; is_str_size = 0; } -#line 1857 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1865 "hl/src/H5LTparse.c" break; case 75: -#line 282 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 280 "hl/src/H5LTparse.y" { if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -1888,33 +1896,33 @@ yyreduce: else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } -#line 1870 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1878 "hl/src/H5LTparse.c" break; case 76: -#line 291 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 289 "hl/src/H5LTparse.y" { if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } -#line 1881 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1889 "hl/src/H5LTparse.c" break; case 77: -#line 298 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 296 "hl/src/H5LTparse.y" { if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } -#line 1892 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1900 "hl/src/H5LTparse.c" break; case 78: -#line 305 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 303 "hl/src/H5LTparse.y" { hid_t str_id = (yyvsp[-1].hid); @@ -1931,71 +1939,71 @@ yyreduce: (yyval.hid) = str_id; } -#line 1913 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1921 "hl/src/H5LTparse.c" break; case 79: -#line 322 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 320 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} -#line 1919 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1927 "hl/src/H5LTparse.c" break; case 81: -#line 325 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 323 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} -#line 1925 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1933 "hl/src/H5LTparse.c" break; case 82: -#line 326 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 324 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} -#line 1931 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1939 "hl/src/H5LTparse.c" break; case 83: -#line 327 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 325 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} -#line 1937 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1945 "hl/src/H5LTparse.c" break; case 84: -#line 329 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 327 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} -#line 1943 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1951 "hl/src/H5LTparse.c" break; case 85: -#line 330 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 328 "hl/src/H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} -#line 1949 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1957 "hl/src/H5LTparse.c" break; case 86: -#line 332 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 330 "hl/src/H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} -#line 1955 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1963 "hl/src/H5LTparse.c" break; case 87: -#line 333 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 331 "hl/src/H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} -#line 1961 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1969 "hl/src/H5LTparse.c" break; case 88: -#line 337 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 335 "hl/src/H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1967 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1975 "hl/src/H5LTparse.c" break; case 89: -#line 339 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 337 "hl/src/H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } -#line 1973 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1981 "hl/src/H5LTparse.c" break; case 92: -#line 344 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 342 "hl/src/H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API @@ -2006,11 +2014,11 @@ yyreduce: free(yylval.sval); yylval.sval = NULL; } -#line 1988 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 1996 "hl/src/H5LTparse.c" break; case 93: -#line 355 "hl/src/H5LTparse.y" /* yacc.c:1646 */ +#line 353 "hl/src/H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2053,11 +2061,12 @@ yyreduce: H5Tclose(super); H5Tclose(native); } -#line 2035 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 2043 "hl/src/H5LTparse.c" break; -#line 2039 "hl/src/H5LTparse.c" /* yacc.c:1646 */ +#line 2047 "hl/src/H5LTparse.c" + default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2082,14 +2091,13 @@ yyreduce: /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } goto yynewstate; @@ -2172,12 +2180,10 @@ yyerrlab: | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ @@ -2239,6 +2245,7 @@ yyacceptlab: yyresult = 0; goto yyreturn; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -2246,6 +2253,7 @@ yyabortlab: yyresult = 1; goto yyreturn; + #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | @@ -2256,6 +2264,10 @@ yyexhaustedlab: /* Fall through. */ #endif + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 3d7b4e8..73a76e9 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.4.1. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + #ifndef YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED # define YY_H5LTYY_HL_SRC_H5LTPARSE_H_INCLUDED /* Debug traces. */ @@ -106,17 +110,18 @@ extern int H5LTyydebug; /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; union YYSTYPE { -#line 74 "hl/src/H5LTparse.y" /* yacc.c:1909 */ +#line 72 "hl/src/H5LTparse.y" int ival; /*for integer token*/ char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ -#line 119 "hl/src/H5LTparse.h" /* yacc.c:1909 */ +#line 122 "hl/src/H5LTparse.h" + }; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index ec029ea..8fb575c 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -295,7 +295,8 @@ Gif2Mem(BYTE *MemGif, GIFTOMEM *GifMemoryStruct) fprintf(stderr, "Error reading Graphic Control Extension information\n"); - if (!*MemGif++ == 0) + (*MemGif)++; + if ((!*MemGif) == 0) fprintf(stderr, "Error reading Graphic Control Extension\n"); diff --git a/src/H5Adense.c b/src/H5Adense.c index bddfe31..7491dd2 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -299,7 +299,7 @@ done: static herr_t H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) { - H5A_t const **user_attr = (H5A_t const **)_user_attr; /* User data from v2 B-tree attribute lookup */ + const H5A_t **user_attr = (const H5A_t **)_user_attr; /* User data from v2 B-tree attribute lookup */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -308,6 +308,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) HDassert(attr); HDassert(user_attr); HDassert(took_ownership); + /* * If there is an attribute already stored in "user_attr", * we need to free the dynamially allocated spaces for the @@ -324,7 +325,7 @@ H5A__dense_fnd_cb(const H5A_t *attr, hbool_t *took_ownership, void *_user_attr) * allocated spaces for the intermediate decoded attribute. */ if(*user_attr != NULL) { - H5A_t *old_attr = *user_attr; + H5A_t *old_attr = *(H5A_t **)_user_attr; /* Free any dynamically allocated items */ if(old_attr->shared) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 6fdea92..7a07225 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -265,7 +265,7 @@ static int H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void * static herr_t H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims, const hsize_t *max_dims); static void *H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline); -static void *H5D__chunk_mem_xfree(void *chk, const H5O_pline_t *pline); +static void *H5D__chunk_mem_xfree(void *chk, const void *pline); static void *H5D__chunk_mem_realloc(void *chk, size_t size, const H5O_pline_t *pline); static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); @@ -1354,7 +1354,7 @@ H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline) /*------------------------------------------------------------------------- * Function: H5D__chunk_mem_xfree * - * Purpose: Free space for a chunk in memory. This routine allocates + * Purpose: Free space for a chunk in memory. This routine releases * memory space for non-filtered chunks from a block free list * and uses malloc()/free() for filtered chunks. * @@ -1366,8 +1366,10 @@ H5D__chunk_mem_alloc(size_t size, const H5O_pline_t *pline) *------------------------------------------------------------------------- */ static void * -H5D__chunk_mem_xfree(void *chk, const H5O_pline_t *pline) +H5D__chunk_mem_xfree(void *chk, const void *_pline) { + const H5O_pline_t *pline = (const H5O_pline_t *)_pline; + FUNC_ENTER_STATIC_NOERR if(chk) { diff --git a/src/H5Dint.c b/src/H5Dint.c index 2824dcd..1e9c6ff 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -50,7 +50,7 @@ /* General stuff */ static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type); +static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type); static herr_t H5D__cache_dataspace_info(const H5D_t *dset); static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); static herr_t H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id); @@ -522,7 +522,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, H5T_t *type) +H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { htri_t relocatable; /* Flag whether the type is relocatable */ htri_t immutable; /* Flag whether the type is immutable */ @@ -1199,6 +1199,7 @@ H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, /* Get the dataset's datatype */ if(NULL == (dt = (H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") + /* If this is a named datatype, get the pointer via the VOL plugin */ type = H5T_get_actual_type(dt); diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 6cfef55..b1d3430 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -771,7 +771,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) buf += nseen*2*8; if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen*2, x, NULL, H5P_DEFAULT)<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1) - ap = (haddr_t*)x; + ap = (haddr_t*)((void *)x); UNIQUE_MEMBERS(map, mt) { memb_addr[_unmapped] = *ap++; memb_eoa[_unmapped] = *ap++; @@ -1955,6 +1955,14 @@ compute_next(H5FD_multi_t *file) * *------------------------------------------------------------------------- */ +/* Disable warning for "format not a string literal" here -QAK */ +/* + * This pragma only needs to surround the snprintf() call with + * tmp in the code below, but early (4.4.7, at least) gcc only + * allows diagnostic pragmas to be toggled outside of functions. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" static int open_members(H5FD_multi_t *file) { @@ -1972,7 +1980,8 @@ open_members(H5FD_multi_t *file) /* Note: This truncates the user's filename down to only sizeof(tmp) * characters. -QK & JK, 2013/01/17 */ - sprintf(tmp, file->fa.memb_name[mt], file->name); + snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name); + tmp[sizeof(tmp) - 1] = '\0'; H5E_BEGIN_TRY { file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF); @@ -1987,6 +1996,7 @@ open_members(H5FD_multi_t *file) return 0; } +#pragma GCC diagnostic pop #ifdef _H5private_H diff --git a/src/H5Fint.c b/src/H5Fint.c index 4021e41..6879d46 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -572,11 +572,11 @@ H5F__build_name(const char *prefix, const char *file_name, char **full_name/*out fname_len = HDstrlen(file_name); /* Allocate a buffer to hold the filename + prefix + possibly the delimiter + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 2))) + if(NULL == (*full_name = (char *)H5MM_malloc(prefix_len + fname_len + 4))) HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate filename buffer") /* Compose the full file name */ - HDsnprintf(*full_name, (prefix_len + fname_len + 2), "%s%s%s", prefix, + HDsnprintf(*full_name, (prefix_len + fname_len + 4), "%s%s%s", prefix, ((prefix_len == 0 || H5_CHECK_DELIMITER(prefix[prefix_len - 1])) ? "" : H5_DIR_SEPS), file_name); done: @@ -2840,8 +2840,7 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) /* test to see if a buffer was provided -- if not, we are done */ if(buf_ptr != NULL) { size_t space_needed; /* size of file image */ - hsize_t tmp; - size_t tmp_size; + unsigned tmp, tmp_size; /* Check for buffer too small */ if((haddr_t)buf_len < eoa) @@ -2856,12 +2855,12 @@ H5F__get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) /* Offset to "status_flags" in the superblock */ tmp = H5F_SUPER_STATUS_FLAGS_OFF(file->shared->sblock->super_vers); + /* Size of "status_flags" depends on the superblock version */ tmp_size = H5F_SUPER_STATUS_FLAGS_SIZE(file->shared->sblock->super_vers); /* Clear "status_flags" */ - HDmemset((uint8_t *)(buf_ptr) + tmp, 0, tmp_size); - + HDmemset((uint8_t *)buf_ptr + tmp, 0, tmp_size); } /* end if */ done: diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 5f25ddc..1dd07c1 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -140,14 +140,14 @@ /* For superblock version 0 & 1: Offset to the file consistency flags (status_flags) in the superblock (excluding H5F_SUPERBLOCK_FIXED_SIZE) */ -#define H5F_SUPER_STATUS_OFF_V01 \ - (2 /* freespace, and root group versions */ \ - + 1 /* reserved */ \ - + 3 /* shared header vers, size of address, size of lengths */ \ - + 1 /* reserved */ \ - + 4) /* group leaf k, group internal k */ - -#define H5F_SUPER_STATUS_OFF(v) (v >= 2 ? 2 : H5F_SUPER_STATUS_OFF_V01) +#define H5F_SUPER_STATUS_OFF_V01 \ + (unsigned)(2 /* freespace, and root group versions */ \ + + 1 /* reserved */ \ + + 3 /* shared header vers, size of address, size of lengths */ \ + + 1 /* reserved */ \ + + 4) /* group leaf k, group internal k */ + +#define H5F_SUPER_STATUS_OFF(v) (v >= 2 ? (unsigned)2 : H5F_SUPER_STATUS_OFF_V01) /* Offset to the file consistency flags (status_flags) in the superblock */ #define H5F_SUPER_STATUS_FLAGS_OFF(v) (H5F_SUPERBLOCK_FIXED_SIZE + H5F_SUPER_STATUS_OFF(v)) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 4fcc164..5334c51 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -54,7 +54,6 @@ /********************/ static herr_t H5F__super_ext_create(H5F_t *f, H5O_loc_t *ext_ptr); static herr_t H5F__update_super_ext_driver_msg(H5F_t *f); -static herr_t H5F__fsinfo_set_version(const H5F_t *f, H5O_fsinfo_t *fsinfo); /*********************/ diff --git a/src/H5I.c b/src/H5I.c index 9fd0326..6b5210d 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -117,7 +117,7 @@ static H5I_id_type_t *H5I_id_type_list_g[H5I_MAX_NUM_TYPES]; /* Starts at 1 instead of 0 because it makes trace output look nicer. If more */ /* types (or IDs within a type) are needed, adjust TYPE_BITS in H5Ipkg.h */ /* and/or increase size of hid_t */ -static H5I_type_t H5I_next_type = (H5I_type_t) H5I_NTYPES; +static int H5I_next_type = (int)H5I_NTYPES; /* Declare a free list to manage the H5I_id_info_t struct */ H5FL_DEFINE_STATIC(H5I_id_info_t); @@ -168,16 +168,16 @@ H5I_term_package(void) if(H5_PKG_INIT_VAR) { H5I_id_type_t *type_ptr; /* Pointer to ID type */ - H5I_type_t type; /* Type of ID */ + int type; /* Type of ID */ /* How many types are still being used? */ - for(type = (H5I_type_t)0; type < H5I_next_type; H5_INC_ENUM(H5I_type_t, type)) + for(type = 0; type < H5I_next_type; type++) if((type_ptr = H5I_id_type_list_g[type]) && type_ptr->ids) n++; /* If no types are used then clean up */ if(0 == n) { - for(type = (H5I_type_t)0; type < H5I_next_type; H5_INC_ENUM(H5I_type_t,type)) { + for(type = 0; type < H5I_next_type; type++) { type_ptr = H5I_id_type_list_g[type]; if(type_ptr) { HDassert(NULL == type_ptr->ids); @@ -226,10 +226,10 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) /* Generate a new H5I_type_t value */ - /* Increment the number of types*/ + /* Increment the number of types */ if(H5I_next_type < H5I_MAX_NUM_TYPES) { - new_type = H5I_next_type; - H5_INC_ENUM(H5I_type_t, H5I_next_type); + new_type = (H5I_type_t)H5I_next_type; + H5I_next_type++; } /* end if */ else { hbool_t done; /* Indicate that search was successful */ @@ -247,7 +247,7 @@ H5Iregister_type(size_t hash_size, unsigned reserved, H5I_free_t free_func) /* Verify that we found a type to give out */ if(done == FALSE) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded.") + HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_BADID, "Maximum number of ID types exceeded") } /* end else */ /* Allocate new ID class */ @@ -298,7 +298,7 @@ H5I_register_type(const H5I_class_t *cls) /* Sanity check */ HDassert(cls); - HDassert(cls->type_id > 0 && cls->type_id < H5I_MAX_NUM_TYPES); + HDassert(cls->type_id > 0 && (int)cls->type_id < H5I_MAX_NUM_TYPES); /* Initialize the type */ if(NULL == H5I_id_type_list_g[cls->type_id]) { @@ -355,13 +355,13 @@ H5Itype_exists(H5I_type_t type) FUNC_ENTER_API(FAIL) H5TRACE1("t", "It", type); + /* Validate parameter */ if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") - - if (type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if (NULL == H5I_id_type_list_g[type]) + if(NULL == H5I_id_type_list_g[type]) ret_value = FALSE; done: @@ -400,7 +400,7 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) * the private interface handle it, because the public interface throws * an error when the supplied type does not exist. */ - if(type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") if(NULL == H5I_id_type_list_g[type]) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") @@ -442,7 +442,8 @@ H5I_nmembers(H5I_type_t type) FUNC_ENTER_NOAPI(FAIL) - if(type <= H5I_BADID || type >= H5I_next_type) + /* Validate parameter */ + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") if(NULL == (type_ptr = H5I_id_type_list_g[type]) || type_ptr->init_count <= 0) HGOTO_DONE(0); @@ -553,7 +554,8 @@ H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref) FUNC_ENTER_NOAPI(FAIL) - if(type <= H5I_BADID || type >= H5I_next_type) + /* Validate parameters */ + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") udata.type_ptr = H5I_id_type_list_g[type]; @@ -696,7 +698,8 @@ H5I__destroy_type(H5I_type_t type) FUNC_ENTER_STATIC - if(type <= H5I_BADID || type >= H5I_next_type) + /* Validate parameter */ + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; @@ -779,7 +782,7 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if (type <= H5I_BADID || type >= H5I_next_type) + if (type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) @@ -846,7 +849,7 @@ H5I_register_using_existing_id(H5I_type_t type, void *object, hbool_t app_ref, h HGOTO_ERROR(H5E_ATOM, H5E_BADRANGE, FAIL, "ID already in use") /* Make sure type number is valid */ - if(type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") /* Get type pointer from list of types */ @@ -967,10 +970,10 @@ H5Iobject_verify(hid_t id, H5I_type_t id_type) FUNC_ENTER_API(NULL) H5TRACE2("*x", "iIt", id, id_type); + /* Validate parameters */ if(H5I_IS_LIB_TYPE(id_type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") - - if(id_type < 1 || id_type >= H5I_next_type) + if(id_type < 1 || (int)id_type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "identifier has invalid type") ret_value = H5I_object_verify(id, id_type); @@ -1003,7 +1006,7 @@ H5I_object_verify(hid_t id, H5I_type_t id_type) FUNC_ENTER_NOAPI_NOERR - HDassert(id_type >= 1 && id_type < H5I_next_type); + HDassert(id_type >= 1 && (int)id_type < H5I_next_type); /* Verify that the type of the ID is correct & lookup the ID */ if(id_type == H5I_TYPE(id) && NULL != (id_ptr = H5I__find_id(id))) { @@ -1043,7 +1046,7 @@ H5I_get_type(hid_t id) if(id > 0) ret_value = H5I_TYPE(id); - HDassert(ret_value >= H5I_BADID && ret_value < H5I_next_type); + HDassert(ret_value >= H5I_BADID && (int)ret_value < H5I_next_type); FUNC_LEAVE_NOAPI(ret_value) } /* end H5I_get_type() */ @@ -1074,7 +1077,7 @@ H5Iget_type(hid_t id) ret_value = H5I_get_type(id); - if(ret_value <= H5I_BADID || ret_value >= H5I_next_type || NULL == H5I_object(id)) + if(ret_value <= H5I_BADID || (int)ret_value >= H5I_next_type || NULL == H5I_object(id)) HGOTO_DONE(H5I_BADID); done: @@ -1218,7 +1221,7 @@ H5I_remove(hid_t id) /* Check arguments */ type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if(type_ptr == NULL || type_ptr->init_count <= 0) @@ -1581,14 +1584,13 @@ H5Iinc_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if (type <= 0 || type >= H5I_next_type) + if(type <= 0 || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type") - - if (H5I_IS_LIB_TYPE(type)) + if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type") /* Do actual increment operation */ - if ((ret_value = H5I__inc_type_ref(type)) < 0) + if((ret_value = H5I__inc_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, (-1), "can't increment ID type ref count") done: @@ -1615,11 +1617,11 @@ H5I__inc_type_ref(H5I_type_t type) FUNC_ENTER_STATIC /* Sanity check */ - HDassert(type > 0 && type < H5I_next_type); + HDassert(type > 0 && (int)type < H5I_next_type); /* Check arguments */ type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr) + if(NULL == type_ptr) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") /* Set return value */ @@ -1699,11 +1701,11 @@ H5I_dec_type_ref(H5I_type_t type) FUNC_ENTER_NOAPI((-1)) - if (type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, (-1), "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if (type_ptr == NULL || type_ptr->init_count <= 0) + if(type_ptr == NULL || type_ptr->init_count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "invalid type") /* Decrement the number of users of the atomic type. If this is the @@ -1711,14 +1713,14 @@ H5I_dec_type_ref(H5I_type_t type) * free all memory it used. The free function is invoked for each atom * being freed. */ - if (1 == type_ptr->init_count) { + if(1 == type_ptr->init_count) { H5I__destroy_type(type); ret_value = 0; - } + } /* end if */ else { --(type_ptr->init_count); ret_value = (herr_t)type_ptr->init_count; - } + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -1744,14 +1746,13 @@ H5Iget_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if (type <= 0 || type >= H5I_next_type) + if(type <= 0 || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, (-1), "invalid ID type") - - if (H5I_IS_LIB_TYPE(type)) + if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, (-1), "cannot call public function on library type") /* Do actual retrieve operation */ - if ((ret_value = H5I__get_type_ref(type)) < 0) + if((ret_value = H5I__get_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, (-1), "can't get ID type ref count") done: @@ -2079,12 +2080,12 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if (type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; /* Only iterate through ID list if it is initialized and there are IDs in type */ - if (type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { + if(type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { H5I_iterate_ud_t iter_udata; /* User data for iteration callback */ herr_t iter_status; /* Iteration status */ @@ -2095,7 +2096,7 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re iter_udata.obj_type = type; /* Iterate over IDs */ - if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) + if((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed") } /* end if */ @@ -2127,11 +2128,10 @@ H5I__find_id(hid_t id) /* Check arguments */ type = H5I_TYPE(id); - if (type <= H5I_BADID || type >= H5I_next_type) + if(type <= H5I_BADID || (int)type >= H5I_next_type) HGOTO_DONE(NULL) - type_ptr = H5I_id_type_list_g[type]; - if (!type_ptr || type_ptr->init_count <= 0) + if(!type_ptr || type_ptr->init_count <= 0) HGOTO_DONE(NULL) /* Locate the ID node for the ID */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 609f2eb..eae7cd6 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -459,9 +459,9 @@ H5O_pline_size(const H5F_t H5_ATTR_UNUSED *f, const void *mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Message header */ - ret_value = 1 + /*version */ + ret_value = (size_t)(1 + /*version */ 1 + /*number of filters */ - (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0); /*reserved */ + (pline->version == H5O_PLINE_VERSION_1 ? 6 : 0)); /*reserved */ /* Calculate size of each filter in pipeline */ for(i = 0; i < pline->nused; i++) { diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index b7f70d1..b4f00ea 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -355,11 +355,11 @@ H5O_sdspace_size(const H5F_t *f, const void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Basic information for all dataspace messages */ - ret_value = 1 + /* Version */ + ret_value = (size_t)(1 + /* Version */ 1 + /* Rank */ 1 + /* Flags */ 1 + /* Dataspace type/reserved */ - ((space->version > H5O_SDSPACE_VERSION_1) ? 0 : 4); /* Eliminated/reserved */ + ((space->version > H5O_SDSPACE_VERSION_1) ? 0 : 4)); /* Eliminated/reserved */ /* Add in the dimension sizes */ ret_value += space->rank * H5F_SIZEOF_SIZE(f); diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 04248b5..5125839 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -673,12 +673,12 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo size_t len; /* Allocate & initialize the path name */ - len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(dp->d_name) + 1 /*\0*/; + len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(dp->d_name) + 5 /*\0*/; if (NULL == (path = (char *)H5MM_calloc(len))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") - HDsnprintf(path, len, "%s/%s", dir, dp->d_name); + HDsnprintf(path, len, "%s%s%s", dir, H5PL_PATH_SEPARATOR, dp->d_name); /* Get info for directory entry */ if (HDstat(path, &my_stat) == -1) diff --git a/src/H5Pint.c b/src/H5Pint.c index 0670adc..911a126 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -5235,7 +5235,7 @@ H5P__get_class_path(H5P_genclass_t *pclass) /* Allocate enough space for the parent class's path, plus the '/' * separator, this class's name and the string terminator */ - ret_str_len = HDstrlen(par_path) + 1 + HDstrlen(pclass->name) + 1; + ret_str_len = HDstrlen(par_path) + HDstrlen(pclass->name) + 3 + 1; if(NULL == (ret_value = (char *)H5MM_malloc(ret_str_len))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for class name") diff --git a/src/H5T.c b/src/H5T.c index 9585121..8eada62 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4732,14 +4732,14 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, if(H5T_g.soft[i].conv.is_app) { if((H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ path_init_error = TRUE; } /* end if */ } /* end if */ else if((H5T_g.soft[i].conv.u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL) < 0) { HDmemset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(H5E_DEFAULT); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ path_init_error = TRUE; } /* end if */ diff --git a/src/H5Toh.c b/src/H5Toh.c index b21ce72..ab6c09f 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -221,6 +221,7 @@ H5O__dtype_get_oloc(hid_t obj_id) /* Get the datatype */ if(NULL == (dt = (H5T_t *)H5I_object(obj_id))) HGOTO_ERROR(H5E_OHDR, H5E_BADATOM, NULL, "couldn't get object from ID") + /* If this is a named datatype, get the VOL driver pointer to the datatype */ type = (H5T_t *)H5T_get_actual_type(dt); diff --git a/src/H5system.c b/src/H5system.c index 5d2663e..bd5f9c5 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -1301,11 +1301,11 @@ H5_combine_path(const char* path1, const char* path2, char **full_name /*out*/) * Allocate a buffer to hold path1 + path2 + possibly the delimiter * + terminating null byte */ - if(NULL == (*full_name = (char *)H5MM_malloc(path1_len + path2_len + 2))) + if(NULL == (*full_name = (char *)H5MM_malloc(path1_len + path2_len + 4))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate filename buffer") /* Compose the full file name */ - HDsnprintf(*full_name, (path1_len + path2_len + 2), "%s%s%s", path1, + HDsnprintf(*full_name, (path1_len + path2_len + 4), "%s%s%s", path1, (H5_CHECK_DELIMITER(path1[path1_len - 1]) ? "" : H5_DIR_SEPS), path2); } /* end else */ diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 15d10a7..9173531 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -22,6 +22,7 @@ set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h ${HDF5_TEST_SOURCE_DIR}/external_common.h + ${HDF5_TEST_SOURCE_DIR}/external_fname.h ${HDF5_TEST_SOURCE_DIR}/swmr_common.h ) diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c index 23bec6e..826957f 100644 --- a/test/enc_dec_plist.c +++ b/test/enc_dec_plist.c @@ -190,8 +190,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char* low_string; /* The low bound string */ - char* high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/external.c b/test/external.c index 6aa9d1b..597878f 100644 --- a/test/external.c +++ b/test/external.c @@ -18,6 +18,7 @@ * Purpose: Tests datasets stored in external raw files. */ #include "external_common.h" +#include "external_fname.h" /*------------------------------------------------------------------------- @@ -864,7 +865,7 @@ test_path_absolute(hid_t fapl) hid_t dset = -1; /* dataset */ size_t i; /* miscellaneous counter */ char cwdpath[1024]; /* working directory */ - char filename[1024]; /* file name */ + char filename[1536]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ hsize_t cur_size; /* current data space size */ diff --git a/test/external_common.h b/test/external_common.h index 1e4fe7a..a2cb03e 100644 --- a/test/external_common.h +++ b/test/external_common.h @@ -23,16 +23,6 @@ /* Include test header files */ #include "h5test.h" -static const char *EXT_FNAME[] = { - "extern_1", - "extern_2", - "extern_3", - "extern_4", - "extern_dir/file_1", - "extern_5", - NULL -}; - /* A similar collection of files is used for the tests that * perform file I/O. */ @@ -42,4 +32,6 @@ static const char *EXT_FNAME[] = { #define GARBAGE_PER_FILE 10 H5TEST_DLL herr_t reset_raw_data_files(int); + #endif /* _EXTERNAL_COMMON_H */ + diff --git a/test/external_env.c b/test/external_env.c index 1bf0cf0..8ecebf6 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -15,6 +15,7 @@ * Purpose: Tests datasets stored in external raw files. */ #include "external_common.h" +#include "external_fname.h" static const char *EXT_ENV_FNAME[] = { "extern_env_dir/env_file_1", diff --git a/test/external_fname.h b/test/external_fname.h new file mode 100644 index 0000000..c5111b6 --- /dev/null +++ b/test/external_fname.h @@ -0,0 +1,37 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * July, 2019 + * + * Purpose: Private declaration for external.c and external_env.c + */ +#ifndef _EXTERNAL_FNAME_H +#define _EXTERNAL_FNAME_H + +/* Include test header files */ +#include "h5test.h" + +static const char *EXT_FNAME[] = { + "extern_1", + "extern_2", + "extern_3", + "extern_4", + "extern_dir/file_1", + "extern_5", + NULL +}; + +#endif /* _EXTERNAL_FNAME_H */ + diff --git a/test/fheap.c b/test/fheap.c index 91a1df5..1ad5c11 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -6650,7 +6650,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if((H5HF_close(fh)) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR fh = NULL; @@ -6842,7 +6842,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara FAIL_STACK_ERROR /* Close the fractal heap */ - if((H5HF_close(fh)) < 0) + if(H5HF_close(fh) < 0) TEST_ERROR fh = NULL; @@ -7012,6 +7012,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t /* Close the fractal heap */ if(H5HF_close(fh) < 0) FAIL_STACK_ERROR + fh = NULL; /* Close the file */ if(H5Fclose(file) < 0) @@ -13694,28 +13695,30 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ - H5HF_create_t tmp_cparam; /* Local heap creation parameters */ - fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ - size_t id_len; /* Size of fractal heap IDs */ - h5_stat_size_t empty_size; /* Size of a file with an empty heap */ - h5_stat_size_t file_size; /* Size of file currently */ - unsigned char *heap_id = NULL; /* Heap ID for object */ - size_t obj_size; /* Size of object */ - size_t robj_size; /* Size of object read */ - unsigned char obj_type; /* Type of storage for object */ - fheap_heap_state_t state; /* State of fractal heap */ - unsigned deflate_level; /* Deflation level */ - size_t old_actual_id_len =0 ; /* Old actual ID length */ - hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ - const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ + H5HF_create_t tmp_cparam; /* Local heap creation parameters */ + fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ + size_t id_len; /* Size of fractal heap IDs */ + h5_stat_size_t empty_size; /* Size of a file with an empty heap */ + h5_stat_size_t file_size; /* Size of file currently */ + unsigned char *heap_id = NULL; /* Heap ID for object */ + size_t obj_size; /* Size of object */ + size_t robj_size; /* Size of object read */ + unsigned char obj_type; /* Type of storage for object */ + fheap_heap_state_t state; /* State of fractal heap */ + unsigned deflate_level; /* Deflation level */ + size_t old_actual_id_len = 0; /* Old actual ID length */ + hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ + hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */ + const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ - /* Copy heap creation properties */ - HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); + /* Copy heap creation properties */ + HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); /* Set an I/O filter for heap data */ deflate_level = 6; if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, (size_t)1, &deflate_level) < 0) FAIL_STACK_ERROR + pline_init = TRUE; /* Adjust actual ID length, if asking for IDs that can directly access 'huge' objects */ if(cparam->id_len == 1) { @@ -13878,7 +13881,7 @@ error: H5MM_xfree(heap_id); if(fh) H5HF_close(fh); - if(&tmp_cparam.pline) + if(pline_init) H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */ H5Fclose(file); } H5E_END_TRY; diff --git a/test/h5test.c b/test/h5test.c index 59ccfe4..99b2010 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -2016,7 +2016,7 @@ error: * *------------------------------------------------------------------------- */ -char * +const char * h5_get_version_string(H5F_libver_t libver) { return(LIBVER_NAMES[libver]); diff --git a/test/h5test.h b/test/h5test.h index 448813e..a0c8974 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -149,7 +149,7 @@ H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_co H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl); H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void); H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void); -H5TEST_DLL char *h5_get_version_string(H5F_libver_t libver); +H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver); /* Functions that will replace components of a FAPL */ H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id); diff --git a/test/ohdr.c b/test/ohdr.c index facedd5..c5d5ac4 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -1626,8 +1626,8 @@ main(void) /* Loop through all the combinations of low/high library format bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { - char *low_string = NULL; /* Message for library version low bound */ - char *high_string = NULL; /* Message for library version high bound */ + const char *low_string; /* Message for library version low bound */ + const char *high_string; /* Message for library version high bound */ char msg[80]; /* Message for file format version */ /* Set version bounds before opening the file */ diff --git a/test/tid.c b/test/tid.c index 7f61c6a..d0ae3e4 100644 --- a/test/tid.c +++ b/test/tid.c @@ -498,7 +498,7 @@ static int test_id_type_list(void) goto out; /* Sanity check */ - if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) + if((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) { /* Error condition, throw an error */ CHECK(1, 1, "H5Iregister_type"); diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 5e26888..9eeaa24 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -38,7 +38,7 @@ /* Having a common dataset name is an error */ #define DATASETNAME "commonname" -#define EXPECTED_ERROR_DEPTH 9 +#define EXPECTED_ERROR_DEPTH 10 #define WRITE_NUMBER 37 /* Typedefs */ diff --git a/test/vds.c b/test/vds.c index a042a75..25d7a0e 100644 --- a/test/vds.c +++ b/test/vds.c @@ -12168,8 +12168,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char *low_string; /* The low bound string */ - char *high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/vds_env.c b/test/vds_env.c index 9c7b698..b2ca9d0 100644 --- a/test/vds_env.c +++ b/test/vds_env.c @@ -315,8 +315,8 @@ main(void) for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, low)) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; H5_INC_ENUM(H5F_libver_t, high)) { char msg[80]; /* Message for file version bounds */ - char *low_string; /* The low bound string */ - char *high_string; /* The high bound string */ + const char *low_string; /* The low bound string */ + const char *high_string; /* The high bound string */ /* Invalid combinations, just continue */ if(high == H5F_LIBVER_EARLIEST || high < low) diff --git a/test/vds_swmr.h b/test/vds_swmr.h index a8e4d50..eb2dcf4 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -77,48 +77,12 @@ /* Dataset dimensions */ #define SM_HEIGHT 2 /* K */ #define LG_HEIGHT 4 /* N */ -#define SM_LG_HEIGHT 6 /* SM_HEIGHT + LG_HEIGHT */ #define FULL_HEIGHT 18 /* (3 * K) + (3 * N) */ -#define HALF_HEIGHT 9 #define WIDTH 8 /* M */ -#define HALF_WIDTH 4 - -/* Max number of planes in the dataset */ -#define N_MAX_PLANES H5S_UNLIMITED /* Number of planes each writer will write */ #define N_PLANES_TO_WRITE 25 -/* Dataset datatypes */ -#define SOURCE_DATATYPE H5T_STD_I32LE -#define VDS_DATATYPE H5T_STD_I32LE - -/* Starting size of datasets, both source and VDS */ -static hsize_t DIMS[N_SOURCES][RANK] = { - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH}, - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH}, - {0, SM_HEIGHT, WIDTH}, - {0, LG_HEIGHT, WIDTH} -}; -static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH}; - -/* Maximum size of datasets, both source and VDS. - * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max - * number of planes written out by the writers before they stop. - * That number is specified separately. - */ -static hsize_t MAX_DIMS[N_SOURCES][RANK] = { - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH}, - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH}, - {N_MAX_PLANES, SM_HEIGHT, WIDTH}, - {N_MAX_PLANES, LG_HEIGHT, WIDTH} -}; -static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH}; - /* Planes */ static hsize_t PLANES[N_SOURCES][RANK] = { {1, SM_HEIGHT, WIDTH}, @@ -128,7 +92,6 @@ static hsize_t PLANES[N_SOURCES][RANK] = { {1, SM_HEIGHT, WIDTH}, {1, LG_HEIGHT, WIDTH} }; -static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH}; /* File names for source datasets */ static char FILE_NAMES[N_SOURCES][NAME_LEN] = { @@ -144,20 +107,9 @@ static char FILE_NAMES[N_SOURCES][NAME_LEN] = { static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5"; /* Dataset names */ -static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; static char VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ -static int32_t FILL_VALUES[N_SOURCES] = { - -1, - -2, - -3, - -4, - -5, - -6 -}; -static int32_t VDS_FILL_VALUE = -9; - #endif /* VDS_SWMR_H */ diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c index 1cb9744..2589653 100644 --- a/test/vds_swmr_gen.c +++ b/test/vds_swmr_gen.c @@ -14,6 +14,52 @@ #include "h5test.h" #include "vds_swmr.h" +/* Max number of planes in the dataset */ +#define N_MAX_PLANES H5S_UNLIMITED + +/* Dataset datatypes */ +#define SOURCE_DATATYPE H5T_STD_I32LE +#define VDS_DATATYPE H5T_STD_I32LE + +/* Starting size of datasets, both source and VDS */ +static hsize_t DIMS[N_SOURCES][RANK] = { + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH}, + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH}, + {0, SM_HEIGHT, WIDTH}, + {0, LG_HEIGHT, WIDTH} +}; +static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH}; + +/* Maximum size of datasets, both source and VDS. + * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max + * number of planes written out by the writers before they stop. + * That number is specified separately. + */ +static hsize_t MAX_DIMS[N_SOURCES][RANK] = { + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH}, + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH}, + {N_MAX_PLANES, SM_HEIGHT, WIDTH}, + {N_MAX_PLANES, LG_HEIGHT, WIDTH} +}; +static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH}; + +static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset"; + +static int32_t FILL_VALUES[N_SOURCES] = { + -1, + -2, + -3, + -4, + -5, + -6 +}; + +static int32_t VDS_FILL_VALUE = -9; + int main(void) { diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index d0ec77b..eb9a82b 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -14,6 +14,8 @@ #include "h5test.h" #include "vds_swmr.h" +static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH}; + int main(void) { diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index ac385c9..a9a87c9 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -831,7 +831,7 @@ static hsize_t diff_datum( nelmts = ((hvl_t *)((void *)mem1))->len; for (j = 0; j < nelmts; j++) - nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *) mem2)->p)) + j * size, memb_type, index, + nfound += diff_datum(((char *) (((hvl_t *)((void *)mem1))->p)) + j * size, ((char *) (((hvl_t *)((void *)mem2))->p)) + j * size, memb_type, index, rank, dims, acc, pos, opts, obj1, obj2, container1_id, container2_id, ph, members); H5Tclose(memb_type); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index d4fc3a2..41a40f1 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -211,7 +211,7 @@ diff_basename(const char *name) * Purpose: Returns the type as a string *------------------------------------------------------------------------- */ -H5_ATTR_PURE H5_ATTR_CONST const char* +H5_ATTR_CONST const char* get_type(h5trav_type_t type) { switch(type) { @@ -242,7 +242,7 @@ get_type(h5trav_type_t type) * Purpose: Returns the sign as a string *------------------------------------------------------------------------- */ -H5_ATTR_PURE const char* +H5_ATTR_CONST const char* get_sign(H5T_sign_t sign) { switch(sign) { @@ -270,7 +270,7 @@ get_sign(H5T_sign_t sign) * Purpose: Returns the class as a string *------------------------------------------------------------------------- */ -H5_ATTR_PURE const char* +H5_ATTR_CONST const char* get_class(H5T_class_t tclass) { switch(tclass) { diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 917d5f5..ecc1fae 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -184,7 +184,7 @@ traverse_cb(hid_t loc_id, const char *path, const H5L_info_t *linfo, if(udata->is_absolute) { size_t base_len = HDstrlen(udata->base_grp_name); size_t add_slash = base_len ? ((udata->base_grp_name)[base_len - 1] != '/') : 1; - size_t new_name_len = base_len + add_slash + HDstrlen(path) + 1; + size_t new_name_len = base_len + add_slash + HDstrlen(path) + 4; if(NULL == (new_name = (char*)HDmalloc(new_name_len))) return(H5_ITER_ERROR); diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index a275443..610c21c 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -22,7 +22,7 @@ */ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); -static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, +static int copy_refs_attr(hid_t loc_in, hid_t loc_out, trav_table_t *travt, hid_t fidout); static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, hid_t fid_out, void *ref_out, trav_table_t *travt); @@ -81,7 +81,7 @@ int do_copy_refobjs(hid_t fidin, if((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed"); - if(copy_refs_attr(grp_in, grp_out, options, travt, fidout) < 0) + if(copy_refs_attr(grp_in, grp_out, travt, fidout) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); if(H5Gclose(grp_out) < 0) @@ -316,7 +316,7 @@ int do_copy_refobjs(hid_t fidin, * copy referenced objects in attributes *------------------------------------------------------------------------- */ - if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0) + if(copy_refs_attr(dset_in, dset_out, travt, fidout) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed"); /*------------------------------------------------------------------------- @@ -426,7 +426,6 @@ done: static int copy_refs_attr(hid_t loc_in, hid_t loc_out, - pack_opt_t *options, trav_table_t *travt, hid_t fidout) /* for saving references */ { @@ -450,7 +449,6 @@ static int copy_refs_attr(hid_t loc_in, is_ref_comp = 0; void *refbuf = NULL; void *buf = NULL; - const char *refname = NULL; unsigned *ref_comp_index = NULL; size_t *ref_comp_size = NULL; int ref_comp_field_n = 0; @@ -604,12 +602,9 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ - for(i = 0; i < (unsigned)nelmts; i++) { - if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0) + for(i = 0; i < (unsigned)nelmts; i++) + if(update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt) < 0) continue; - if(options->verbose) - printf("object <%s> reference created to <%s>\n", name, refname); - } /* i */ } /* H5T_STD_REF_OBJ */ /* handle region references */ else if((is_ref || is_ref_array) && (H5R_DSET_REG_REF_BUF_SIZE == msize)) { @@ -632,12 +627,9 @@ static int copy_refs_attr(hid_t loc_in, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ - for(i = 0; i < (unsigned)nelmts; i++) { - if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0) + for(i = 0; i < (unsigned)nelmts; i++) + if(update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt) < 0) continue; - if(options->verbose) - printf("object <%s> region reference created to <%s>\n", name, refname); - } } /* H5T_STD_REF_DSETREG */ else if (is_ref_vlen) { /* handle VLEN of references */ @@ -700,7 +692,7 @@ static int copy_refs_attr(hid_t loc_in, size_t idx = (i * msize) + H5Tget_member_offset(mtype_id, ref_comp_index[j]); hobj_ref_t ref_out; - if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0) + if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)((void *)(((char *)buf)+idx)), fidout, &ref_out, travt)<0) continue; HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]); } /* if */ diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 88c8ea5..7f80c23 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -172,7 +172,7 @@ gen_enhance_files(hbool_t user) int data[NUM_ELMTS]; /* Buffer for data */ int fd = -1; /* The file descriptor ID */ int64_t eoa; /* The EOA value */ - int32_t chksum; /* The chksum value */ + uint32_t chksum; /* The chksum value */ int i = 0 , j = 0, u = 0; /* Local index variable */ /* Get a copy of the default file creation property */ diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 3962edd..1d2e791 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -70,9 +70,9 @@ const H5Z_class2_t H5Z_COUNTER[1] = {{ * track of the data of chunks being read from file into memory. */ static size_t -counter (unsigned flags, size_t cd_nelmts, - const unsigned *cd_values, size_t nbytes, - size_t *buf_size, void **buf) +counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, + const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes, + size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf) { nbytes_global += nbytes; return nbytes; diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index c6e62d5..1d52471 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -22,6 +22,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5test.h" #ifdef H5_HAVE_PARALLEL @@ -77,7 +78,7 @@ hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t block[RANK], stride[RANK], count[RANK]; -hssize_t start[RANK]; +hsize_t start[RANK]; hid_t fid; /* HDF5 file ID */ hid_t acc_tpl; /* File access templates */ hid_t sid; /* Dataspace ID */ @@ -240,7 +241,7 @@ int main(int argc, char **argv) */ for(j=0; j < opt_iter; j++) { /* setup a file dataspace selection */ - start[0] = (j*iter_jump)+(mynod*opt_block); + start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block)); stride[0] = block[0] = opt_block; count[0]= 1; ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); @@ -293,7 +294,7 @@ int main(int argc, char **argv) /* we are going to repeat the read the same pattern the write used */ for (j=0; j < opt_iter; j++) { /* setup a file dataspace selection */ - start[0] = (j*iter_jump)+(mynod*opt_block); + start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block)); stride[0] = block[0] = opt_block; count[0]= 1; ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); @@ -320,13 +321,13 @@ int main(int argc, char **argv) VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL); - if (ret < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n", + if (ret < 0) HDfprintf(stderr, "node %d, read error, loc = %Ld: %s\n", mynod, mynod*opt_block, strerror(myerrno)); /* if the user wanted to check correctness, compare the write * buffer to the read buffer */ if (opt_correct && memcmp(buf, buf2, opt_block)) { - fprintf(stderr, "node %d, correctness test failed\n", mynod); + HDfprintf(stderr, "node %d, correctness test failed\n", mynod); my_correct = 0; MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN, MPI_COMM_WORLD); @@ -435,10 +436,12 @@ parse_args(int argc, char **argv) * e.g., -a4096/512 allocate at 4096 bytes * boundary if request size >= 512. */ - {char *p; - opt_alignment = atoi(optarg); - if (p=(char*)strchr(optarg, '/')) - opt_threshold = atoi(p+1); + { + char *p; + + opt_alignment = HDatoi(optarg); + if(NULL != (p = (char*)HDstrchr(optarg, '/'))) + opt_threshold = HDatoi(p + 1); } HDfprintf(stdout, "alignment/threshold=%Hu/%Hu\n", -- cgit v0.12