diff --git a/include/nctestserver.h b/include/nctestserver.h index 033d24e657..6df692c9e8 100644 --- a/include/nctestserver.h +++ b/include/nctestserver.h @@ -42,7 +42,7 @@ static int timedping(const char* url, long timeout); static char** parseServers(const char* remotetestservers) { - char* rts; + char* rts = NULL; char** servers = NULL; char** list = NULL; char* p; diff --git a/libdispatch/dcopy.c b/libdispatch/dcopy.c index 111ce86a47..82acc353ad 100644 --- a/libdispatch/dcopy.c +++ b/libdispatch/dcopy.c @@ -534,7 +534,7 @@ NC_copy_att(int ncid_in, int varid_in, const char *name, { /* Copy arbitrary attributes. */ int class; - size_t size; + size_t size = 0; nc_type xtype_out = NC_NAT; if(xtype <= NC_MAX_ATOMIC_TYPE) { diff --git a/libdispatch/dplugins.c b/libdispatch/dplugins.c index 9179f6ecd9..4347d8227b 100644 --- a/libdispatch/dplugins.c +++ b/libdispatch/dplugins.c @@ -61,7 +61,9 @@ nc_plugin_path_initialize(void) int stat = NC_NOERR; struct NCglobalstate* gs = NULL; NCPluginList dirs = {0,NULL}; +#ifdef USE_HDF5 int hdf5found = 0; /* 1 => we got a legit plugin path set from HDF5 */ +#endif if(!NC_initialized) nc_initialize(); if(NC_plugin_path_initialized != 0) goto done; diff --git a/libdispatch/ncexhash.c b/libdispatch/ncexhash.c index 8a65841e15..b52593ed79 100644 --- a/libdispatch/ncexhash.c +++ b/libdispatch/ncexhash.c @@ -285,6 +285,8 @@ exhashlocate(NCexhashmap* map, ncexhashkey_t hkey, NCexleaf** leafp, int* indexp /* Is there room in the leaf to add an entry? */ #if DEBUG >= 3 fprintf(stderr,"locate: iter=%d offset=%x leaf=(%d)%p active=%d\n",iter,offset,leaf->uid,leaf,(int)leaf->active); +#else + (void)iter; #endif if(leaf->active < map->leaflen) break; /* yes, there is room */ /* Not Enough room, so we need to split this leaf */ diff --git a/libdispatch/ncjson.c b/libdispatch/ncjson.c index f9bf7680ec..6a9b46cc6d 100644 --- a/libdispatch/ncjson.c +++ b/libdispatch/ncjson.c @@ -1140,5 +1140,5 @@ netcdf_supresswarnings(void) ignore = (void*)NCJtotext; ignore = (void*)NCJinsertstring; ignore = (void*)NCJinsertint; - ignore = ignore; + (void)ignore; } diff --git a/libnczarr/zplugins.c b/libnczarr/zplugins.c index 2f7b548521..bc24ad041b 100644 --- a/libnczarr/zplugins.c +++ b/libnczarr/zplugins.c @@ -759,7 +759,7 @@ printhdf5(const NCZ_HDF5 h) static void static_unused(void) { void* p = NULL; - p = p; + (void)p; p = static_unused; #if defined(DEBUGF) || defined(DEBUGL) (void)printplugin(NULL); diff --git a/nc_test/tst_diskless.c b/nc_test/tst_diskless.c index d3ce9acabc..132db9a08f 100644 --- a/nc_test/tst_diskless.c +++ b/nc_test/tst_diskless.c @@ -221,7 +221,6 @@ printf("*** testing diskless file with scalar vars..."); size_t start[1] = {0}; size_t count[1] = {DIM1_LEN}; - int i; float float_data = 42.22F, float_data_in; diff --git a/ncdump/ncvalidator.c b/ncdump/ncvalidator.c index 6986704804..09814bc3cd 100644 --- a/ncdump/ncvalidator.c +++ b/ncdump/ncvalidator.c @@ -2107,6 +2107,8 @@ val_NC_check_voff(NC *ncp) prev_off = varp->begin + varp->len; prev = i; } + + (void)nerrs; return status; } diff --git a/ncdump/vardata.c b/ncdump/vardata.c index 62e512500c..a73074e950 100644 --- a/ncdump/vardata.c +++ b/ncdump/vardata.c @@ -544,7 +544,6 @@ vardata( void *vals; int id; - size_t nels; size_t ncols; int vrank = vp->ndims; @@ -555,7 +554,6 @@ vardata( edg = (size_t *) emalloc((size_t)(1 + vrank) * sizeof(size_t)); add = (size_t *) emalloc((size_t)(1 + vrank) * sizeof(size_t)); - nels = 1; if(vrank == 0) { /*scalar*/ cor[0] = 0; edg[0] = 1; @@ -563,7 +561,6 @@ vardata( for (id = 0; id < vrank; id++) { cor[id] = 0; edg[id] = 1; - nels *= vdims[id]; /* total number of values for variable */ } } printf("\n"); diff --git a/ncgen/genbin.c b/ncgen/genbin.c index 019ed52638..0a6e516ce4 100644 --- a/ncgen/genbin.c +++ b/ncgen/genbin.c @@ -420,12 +420,7 @@ genbin_writevar(Generator* generator, Symbol* vsym, Bytebuffer* memory, int rank, size_t* start, size_t* count) { int stat = NC_NOERR; - int i; char* data = bbContents(memory); - size_t nelems; - - /* Compute total number of elements */ - for(nelems=1,i=0;i