diff --git a/src/linad99/derch.cpp b/src/linad99/derch.cpp index dd15acad3..e1b26bd6a 100644 --- a/src/linad99/derch.cpp +++ b/src/linad99/derch.cpp @@ -42,7 +42,8 @@ void derch(const double& _f, const independent_variables & _x, double& f=(double&) _f; int& ireturn = (int&) _ireturn; independent_variables& x= (independent_variables&) _x; - static int i, n1 ,n2,ii; + [[maybe_unused]] static int i; + static int n1 ,n2,ii; static double fsave; static int order_flag; static double s, f1, f2, g2, xsave; diff --git a/src/linad99/df_file.cpp b/src/linad99/df_file.cpp index e68a578d6..165c6b676 100644 --- a/src/linad99/df_file.cpp +++ b/src/linad99/df_file.cpp @@ -146,7 +146,7 @@ DF_FILE::DF_FILE(const size_t nbytes, [[maybe_unused]] const unsigned int id) { buff = new char[buff_size]; } - catch (const std::bad_alloc& e) + catch ([[maybe_unused]] const std::bad_alloc& e) { size_t gb = nbytes / 1073741824; cerr << "Error: Unable to construct DF_FILE memory buffer\n" diff --git a/src/linad99/dmat34.cpp b/src/linad99/dmat34.cpp index 00106a485..9e4aa79d7 100644 --- a/src/linad99/dmat34.cpp +++ b/src/linad99/dmat34.cpp @@ -122,7 +122,7 @@ dvector solve(const dmatrix& aa,const dvector& z, double* pvvj = &vv(lb); for (int j=lb;j<=ub;j++) { - dvector* pbbi = &bb(lb); + pbbi = &bb(lb); for (int i=lb;iget_v() + j); diff --git a/src/linad99/dvect9.cpp b/src/linad99/dvect9.cpp index cbc31fa7b..b4012ffdd 100644 --- a/src/linad99/dvect9.cpp +++ b/src/linad99/dvect9.cpp @@ -227,7 +227,6 @@ dvector::dvector(const char* s) for (int i = 1; i <= count; ++i) { int index = 0; - char c; infile.get(c); while (!infile.eof()) { @@ -479,7 +478,6 @@ void dvector::allocate(const char* s) for (int i = 1; i <= count; ++i) { int index = 0; - char c; infile.get(c); while (!infile.eof()) { diff --git a/src/linad99/fvar_io2.cpp b/src/linad99/fvar_io2.cpp index 90e9fc349..38ac92225 100644 --- a/src/linad99/fvar_io2.cpp +++ b/src/linad99/fvar_io2.cpp @@ -179,7 +179,6 @@ dvar_vector::dvar_vector(const char * s) for (i=1;i<=count;i++) { int index = 0; - char c; infile.get(c); while (!infile.eof()) { diff --git a/src/linad99/gst_read.cpp b/src/linad99/gst_read.cpp index 6044fd98d..cdfbb87f0 100644 --- a/src/linad99/gst_read.cpp +++ b/src/linad99/gst_read.cpp @@ -124,7 +124,7 @@ int grad_stack::read_grad_stack_buffer(OFF_T& lpos) #if defined(DEBUG) assert(sizeof(grad_stack_entry) * length <= UINT_MAX); #endif - ssize_t nread = read(_GRADFILE_PTR, ptr_first, sizeof(grad_stack_entry)*length); + ssize_t nread = read(_GRADFILE_PTR, ptr_first, static_cast(sizeof(grad_stack_entry)*length)); ptr = ptr_first + length-1; if (nread == -1 ) diff --git a/src/linad99/jacob2.cpp b/src/linad99/jacob2.cpp index e2a9d9e85..8b39c7ce9 100644 --- a/src/linad99/jacob2.cpp +++ b/src/linad99/jacob2.cpp @@ -169,11 +169,11 @@ void gradient_structure::jacobcalc(int nvar, const ofstream& _ofs) double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE; - unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset(); + unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset(); size_t size = sizeof(double_and_int ); - for (unsigned int i = 0; i < (max_last_offset/size); i++) + for (unsigned int i = 0; i < (local_max_last_offset/size); i++) { tmp->x = 0; #if defined (__ZTC__) diff --git a/src/linad99/jacob3.cpp b/src/linad99/jacob3.cpp index dd9c15d2b..adc5fa618 100644 --- a/src/linad99/jacob3.cpp +++ b/src/linad99/jacob3.cpp @@ -157,11 +157,11 @@ void gradient_structure::jacobcalc(int nvar, const uostream& ofs) double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE; - unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset(); + unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset(); size_t size = sizeof(double_and_int); - for (unsigned int i = 0; i < (max_last_offset/size); i++) + for (unsigned int i = 0; i < (local_max_last_offset/size); i++) { tmp->x = 0; #if defined (__ZTC__) diff --git a/src/linad99/jacobclc.cpp b/src/linad99/jacobclc.cpp index 358ee6e10..dbe00bbe9 100644 --- a/src/linad99/jacobclc.cpp +++ b/src/linad99/jacobclc.cpp @@ -208,11 +208,11 @@ void gradient_structure::jacobcalc(int nvar, const dmatrix& _jac) double_and_int* tmp = (double_and_int*)ARR_LIST1->ARRAY_MEMBLOCK_BASE; - unsigned long int max_last_offset = ARR_LIST1->get_max_last_offset(); + unsigned long int local_max_last_offset = ARR_LIST1->get_max_last_offset(); size_t size = sizeof(double_and_int); - for (unsigned int i = 0; i < (max_last_offset/size); i++) + for (unsigned int i = 0; i < (local_max_last_offset/size); i++) { tmp->x = 0; #if defined (__ZTC__) diff --git a/src/linad99/minim.cpp b/src/linad99/minim.cpp index e2ad0be6e..b66ba6531 100644 --- a/src/linad99/minim.cpp +++ b/src/linad99/minim.cpp @@ -34,7 +34,7 @@ double fmm::minimize(const independent_variables & x, g.initialize(); #endif { - gradient_structure gs; + gradient_structure local_gs; while (ireturn >= 0) { fmin(f,x,g); diff --git a/src/linad99/sgradclc.cpp b/src/linad99/sgradclc.cpp index 472fe9309..b4b99da48 100644 --- a/src/linad99/sgradclc.cpp +++ b/src/linad99/sgradclc.cpp @@ -266,7 +266,7 @@ void gradient_structure::save_arrays() LSEEK(GRAD_STACK1->_VARSSAV_PTR,0L,SEEK_SET); #if defined(DOS386) - #if (__cplusplus >= 201703L) + #ifndef DEBUG [[maybe_unused]] #endif ssize_t ret = write(GRAD_STACK1->_VARSSAV_PTR, (char*)src, bytes_needed); @@ -326,7 +326,7 @@ void gradient_structure::restore_arrays() LSEEK(GRAD_STACK1->_VARSSAV_PTR,0L,SEEK_SET); #if defined(DOS386) - #if (__cplusplus >= 201703L) + #ifndef DEBUG [[maybe_unused]] #endif ssize_t ret = read(GRAD_STACK1->_VARSSAV_PTR, (char*)dest,bytes_needed);