Suppress warning re unbound variables

This commit is contained in:
Shahram Najm 2016-11-18 13:40:14 +00:00
parent 7c44709ca6
commit b60637b009
2 changed files with 15 additions and 10 deletions

View File

@ -220,17 +220,17 @@ int main(int argc, char *argv[])
break;
}
}
/* After option processing expect just two files */
if (argc-optind != 2) usage(prog);
for (i = optind; i < argc; i++) {
/*for (i = optind; i < argc; i++) {
printf ("File argument %s\n", argv[i]);
}
}*/
infile_name = argv[argc-2];
outfile_name = argv[argc-1];
test_regular_ll(remove_local_def, edition, packingType, infile_name, outfile_name);
test_reduced_gg(remove_local_def, edition, packingType, infile_name, outfile_name);

View File

@ -49,12 +49,17 @@ ${test_dir}grib_util_set_spec $infile $outfile > /dev/null
grib_check_key_equals $outfile section2Used 0
# Convert to edition2 and use JPEG for packing
if [ $HAVE_JPG -eq 1 ]; then
infile=../data/latlon.grib
${test_dir}grib_util_set_spec -e 2 -p grid_jpeg $infile $outfile > /dev/null
res=`${tools_dir}grib_get -p edition,section2Used,packingType $outfile`
[ "$res" = "2 1 grid_jpeg" ]
# Don't complain due to unbound variable
set +u
if [ x"$HAVE_JPG" != "x" ]; then
if [ $HAVE_JPG -eq 1 ]; then
infile=../data/latlon.grib
${test_dir}grib_util_set_spec -e 2 -p grid_jpeg $infile $outfile > /dev/null
res=`${tools_dir}grib_get -p edition,section2Used,packingType $outfile`
[ "$res" = "2 1 grid_jpeg" ]
fi
fi
set -u
# --------------------------------------------------
# Reduced Gaussian Grid N=32 second order packing