diff --git a/src/df1b2-separable/df1b2chkder.cpp b/src/df1b2-separable/df1b2chkder.cpp index b32f84781..376f4b7c1 100644 --- a/src/df1b2-separable/df1b2chkder.cpp +++ b/src/df1b2-separable/df1b2chkder.cpp @@ -39,7 +39,7 @@ adtimer* ad_comm::ptm1 = nullptr; * \param */ void laplace_approximation_calculator:: - check_derivatives(__attribute__((unused)) const dvector& _x, __attribute__((unused)) function_minimizer* pfmin, __attribute__((unused)) double f) + check_derivatives([[maybe_unused]] const dvector& _x, [[maybe_unused]] function_minimizer* pfmin, [[maybe_unused]] double f) { #ifdef DIAG cerr << "need to define this" << endl; diff --git a/src/df1b2-separable/df1b2f15.cpp b/src/df1b2-separable/df1b2f15.cpp index 7f1540a22..995e61366 100644 --- a/src/df1b2-separable/df1b2f15.cpp +++ b/src/df1b2-separable/df1b2f15.cpp @@ -23,7 +23,7 @@ void df1b2_init_vector::allocate(int mmin,int mmax,const adstring&s) * Description not yet available. * \param */ -void df1b2_init_vector::allocate(int mmin,int mmax,int ps, __attribute__((unused)) const adstring&s) +void df1b2_init_vector::allocate(int mmin,int mmax,int ps, [[maybe_unused]] const adstring&s) { set_phase_start(ps); df1b2vector::allocate(mmin,mmax); @@ -109,7 +109,7 @@ int initial_df1b2params::set_index(void) * \param */ void df1b2_init_vector::set_value(const init_df1b2vector& _x, - const int& _ii, __attribute__((unused)) const df1b2variable& pen) + const int& _ii, [[maybe_unused]] const df1b2variable& pen) { ADUNCONST(init_df1b2vector,x) ADUNCONST(int,ii) @@ -220,7 +220,7 @@ void df1b2_init_matrix::set_index(int aflag,const int& _ii) * \param */ void df1b2_init_matrix::set_value(const init_df1b2vector& _x, - const int& _ii, __attribute__((unused)) const df1b2variable& pen) + const int& _ii, [[maybe_unused]] const df1b2variable& pen) { ADUNCONST(init_df1b2vector,x) ADUNCONST(int,ii) @@ -245,7 +245,7 @@ void df1b2_init_matrix::set_value(const init_df1b2vector& _x, * \param */ void df1b2_init_number::set_value(const init_df1b2vector& _x,const int& _ii, - __attribute__((unused)) const df1b2variable& pen) + [[maybe_unused]] const df1b2variable& pen) { ADUNCONST(init_df1b2vector,x) ADUNCONST(int,ii) @@ -259,7 +259,7 @@ void df1b2_init_number::set_value(const init_df1b2vector& _x,const int& _ii, * Description not yet available. * \param */ -void df1b2_init_number::allocate(__attribute__((unused)) const adstring& s) +void df1b2_init_number::allocate([[maybe_unused]] const adstring& s) { if (!df1b2variable::noallocate) { @@ -272,7 +272,7 @@ void df1b2_init_number::allocate(__attribute__((unused)) const adstring& s) * Description not yet available. * \param */ -void df1b2_init_number::allocate(int _n, __attribute__((unused)) const adstring& s) +void df1b2_init_number::allocate(int _n, [[maybe_unused]] const adstring& s) { df1b2variable::allocate(); set_phase_start(_n); @@ -282,7 +282,7 @@ void df1b2_init_number::allocate(int _n, __attribute__((unused)) const adstring& * Description not yet available. * \param */ -void df1b2variable::allocate(__attribute__((unused)) const char *s) +void df1b2variable::allocate([[maybe_unused]] const char *s) { df1b2variable::allocate(); } @@ -707,7 +707,7 @@ void df1b2_init_bounded_vector::allocate(int mmin,int mmax, * \param */ void df1b2_init_bounded_vector::allocate(int mmin,int mmax, - double _minb,double _maxb, __attribute__((unused)) const char* s) + double _minb,double _maxb, [[maybe_unused]] const char* s) { allocate(mmin,mmax,_minb,_maxb); } @@ -717,7 +717,7 @@ void df1b2_init_bounded_vector::allocate(int mmin,int mmax, * \param */ void df1b2_init_bounded_vector::allocate(int mmin,int mmax, - double _minb,double _maxb,int n, __attribute__((unused)) const char * s) + double _minb,double _maxb,int n, [[maybe_unused]] const char * s) { allocate(mmin,mmax,_minb,_maxb); set_phase_start(n); diff --git a/src/df1b2-separable/df1b2f25.cpp b/src/df1b2-separable/df1b2f25.cpp index 5d074600e..7556de3d3 100644 --- a/src/df1b2-separable/df1b2f25.cpp +++ b/src/df1b2-separable/df1b2f25.cpp @@ -38,7 +38,7 @@ * Description not yet available. * \param */ -void df1b2_init_number::sd_scale(const dvector& _d, __attribute__((unused)) const dvector& x, +void df1b2_init_number::sd_scale(const dvector& _d, [[maybe_unused]] const dvector& x, const int& _ii) { int& ii=(int&) _ii; @@ -82,7 +82,7 @@ void df1b2_init_bounded_number::sd_scale(const dvector& _d,const dvector& x, * Description not yet available. * \param */ -void df1b2_init_vector::sd_scale(const dvector& _v, __attribute__((unused)) const dvector& x, +void df1b2_init_vector::sd_scale(const dvector& _v, [[maybe_unused]] const dvector& x, const int& _ii) { if (allocated()) @@ -104,7 +104,7 @@ void df1b2_init_vector::sd_scale(const dvector& _v, __attribute__((unused)) cons * Description not yet available. * \param */ -void df1b2_init_matrix::sd_scale(const dvector& _v, __attribute__((unused)) const dvector& x, +void df1b2_init_matrix::sd_scale(const dvector& _v, [[maybe_unused]] const dvector& x, const int& _ii) { if (allocated()) diff --git a/src/df1b2-separable/df1b2fn2.cpp b/src/df1b2-separable/df1b2fn2.cpp index 9c2d5f0dd..47a9d82f5 100644 --- a/src/df1b2-separable/df1b2fn2.cpp +++ b/src/df1b2-separable/df1b2fn2.cpp @@ -804,7 +804,7 @@ double d3F(P_USER_FUNCTION pu,const init_df1b2vector& _x,int i,int j,int k, * Description not yet available. * \param */ -dmatrix check_second_derivatives(__attribute__((unused)) const init_df1b2vector& x) +dmatrix check_second_derivatives([[maybe_unused]] const init_df1b2vector& x) { f1b2gradlist->set_no_derivatives(); #ifdef OPT_LIB @@ -831,7 +831,7 @@ dmatrix check_second_derivatives(__attribute__((unused)) const init_df1b2vector& * Description not yet available. * \param */ -d3_array check_third_derivatives(__attribute__((unused)) const init_df1b2vector& x) +d3_array check_third_derivatives([[maybe_unused]] const init_df1b2vector& x) { f1b2gradlist->set_no_derivatives(); #ifdef OPT_LIB @@ -932,7 +932,7 @@ void re_objective_function_value::allocate(void) * Description not yet available. * \param */ -void re_objective_function_value::allocate(__attribute__((unused)) const char * s) +void re_objective_function_value::allocate([[maybe_unused]] const char * s) { pobjfun=this; df1b2variable::allocate(); diff --git a/src/df1b2-separable/df1b2fn5.cpp b/src/df1b2-separable/df1b2fn5.cpp index 1b3daaff4..ce573194f 100644 --- a/src/df1b2-separable/df1b2fn5.cpp +++ b/src/df1b2-separable/df1b2fn5.cpp @@ -103,7 +103,7 @@ df1b2variable::df1b2variable(void) * Description not yet available. * \param */ -df1b2variable::df1b2variable(__attribute__((unused)) const newadkludge* z) +df1b2variable::df1b2variable([[maybe_unused]] const newadkludge* z) { ptr=0; ncopies=0; @@ -154,7 +154,7 @@ void df1b2variable::allocate(void) * Description not yet available. * \param */ -df1b2variable::df1b2variable(__attribute__((unused)) adkludge1 * adkludgexxx) +df1b2variable::df1b2variable([[maybe_unused]] adkludge1 * adkludgexxx) { // vectors are all 1,...,nvar ptr = (double*) pool->alloc(); diff --git a/src/df1b2-separable/df1b2fnl.cpp b/src/df1b2-separable/df1b2fnl.cpp index 3500c6f72..4c08cf3ac 100644 --- a/src/df1b2-separable/df1b2fnl.cpp +++ b/src/df1b2-separable/df1b2fnl.cpp @@ -359,7 +359,7 @@ funnel_init_df1b2variable::funnel_init_df1b2variable * Description not yet available. * \param */ -void funnel_init_df1b2variable::allocate(__attribute__((unused)) const df1b2variable& x) +void funnel_init_df1b2variable::allocate([[maybe_unused]] const df1b2variable& x) { cerr << "Haven't defined htis yet" << endl; ad_exit(1); @@ -851,7 +851,7 @@ void funnel_init_df1b2vector::set_index(imatrix& y,int& ii) * \param */ void funnel_init_df1b2vector::set_value(const init_df1b2vector& _x, - const int& _ii, __attribute__((unused)) const df1b2variable& _pen) + const int& _ii, [[maybe_unused]] const df1b2variable& _pen) { ADUNCONST(int,ii) ADUNCONST(init_df1b2vector,x) @@ -942,7 +942,7 @@ void funnel_init_bounded_df1b2vector::set_index(imatrix& y,int& ii) * \param */ void funnel_init_bounded_df1b2vector::set_value(const init_df1b2vector& _x, - const int& _ii, __attribute__((unused)) const df1b2variable& _pen) + const int& _ii, [[maybe_unused]] const df1b2variable& _pen) { ADUNCONST(int,ii) ADUNCONST(init_df1b2vector,x) diff --git a/src/df1b2-separable/df1b2fun.cpp b/src/df1b2-separable/df1b2fun.cpp index e949ae151..a1d76f638 100644 --- a/src/df1b2-separable/df1b2fun.cpp +++ b/src/df1b2-separable/df1b2fun.cpp @@ -574,7 +574,7 @@ double ADdiff_fun(double x,double y) * Description not yet available. * \param */ -double ADzero_fun(__attribute__((unused)) double x, __attribute__((unused)) double y) +double ADzero_fun([[maybe_unused]] double x, [[maybe_unused]] double y) { return 0.0; } @@ -583,7 +583,7 @@ double ADzero_fun(__attribute__((unused)) double x, __attribute__((unused)) doub * Description not yet available. * \param */ -double ADzero_fun(__attribute__((unused)) double x) +double ADzero_fun([[maybe_unused]] double x) { return 0.0; } @@ -592,7 +592,7 @@ double ADzero_fun(__attribute__((unused)) double x) * Description not yet available. * \param */ -double AD1_fun(__attribute__((unused)) double x) +double AD1_fun([[maybe_unused]] double x) { return 1.0; } @@ -601,7 +601,7 @@ double AD1_fun(__attribute__((unused)) double x) * Description not yet available. * \param */ -double AD1_fun(__attribute__((unused)) double x, __attribute__((unused)) double y) +double AD1_fun([[maybe_unused]] double x, [[maybe_unused]] double y) { return 1.0; } @@ -610,7 +610,7 @@ double AD1_fun(__attribute__((unused)) double x, __attribute__((unused)) double * Description not yet available. * \param */ -double ADm1_fun(__attribute__((unused)) double x, __attribute__((unused)) double y) +double ADm1_fun([[maybe_unused]] double x, [[maybe_unused]] double y) { return -1.0; } @@ -628,7 +628,7 @@ double AD_id(double x) * Description not yet available. * \param */ -double ADfirst_arg(double x, __attribute__((unused)) double y) +double ADfirst_arg(double x, [[maybe_unused]] double y) { return x; } @@ -637,7 +637,7 @@ double ADfirst_arg(double x, __attribute__((unused)) double y) * Description not yet available. * \param */ -double ADsecond_arg_plus1(__attribute__((unused)) double x, double y) +double ADsecond_arg_plus1([[maybe_unused]] double x, double y) { return y+1; } @@ -646,7 +646,7 @@ double ADsecond_arg_plus1(__attribute__((unused)) double x, double y) * Description not yet available. * \param */ -double ADsecond_arg(__attribute__((unused)) double x, double y) +double ADsecond_arg([[maybe_unused]] double x, double y) { return y; } @@ -655,7 +655,7 @@ double ADsecond_arg(__attribute__((unused)) double x, double y) * Description not yet available. * \param */ -double AD_div_1(__attribute__((unused)) double x, double y) +double AD_div_1([[maybe_unused]] double x, double y) { return 1.0/y; } @@ -682,7 +682,7 @@ double AD_div_22(double x,double y) * Description not yet available. * \param */ -double AD_div_122(__attribute__((unused)) double x, double y) +double AD_div_122([[maybe_unused]] double x, double y) { return 2.0/(y*y*y); } @@ -691,7 +691,7 @@ double AD_div_122(__attribute__((unused)) double x, double y) * Description not yet available. * \param */ -double AD_div_12(__attribute__((unused)) double x, double y) +double AD_div_12([[maybe_unused]] double x, double y) { return -1.0/(y*y); } @@ -700,7 +700,7 @@ double AD_div_12(__attribute__((unused)) double x, double y) * Description not yet available. * \param */ -double AD_div_11(__attribute__((unused)) double x, __attribute__((unused)) double y) +double AD_div_11([[maybe_unused]] double x, [[maybe_unused]] double y) { return 0.0; } @@ -709,7 +709,7 @@ double AD_div_11(__attribute__((unused)) double x, __attribute__((unused)) doubl * Description not yet available. * \param */ -double AD_div_111(__attribute__((unused)) double x, __attribute__((unused)) double y) +double AD_div_111([[maybe_unused]] double x, [[maybe_unused]] double y) { return 0.0; } @@ -718,7 +718,7 @@ double AD_div_111(__attribute__((unused)) double x, __attribute__((unused)) doub * Description not yet available. * \param */ -double AD_div_112(__attribute__((unused)) double x, __attribute__((unused)) double y) +double AD_div_112([[maybe_unused]] double x, [[maybe_unused]] double y) { return 0.0; } @@ -815,7 +815,7 @@ double ADsix_id_fun(double x) * Description not yet available. * \param */ -double ADsix_fun(__attribute__((unused)) double x) +double ADsix_fun([[maybe_unused]] double x) { return 6.0; } @@ -824,7 +824,7 @@ double ADsix_fun(__attribute__((unused)) double x) * Description not yet available. * \param */ -double ADtwo_fun(__attribute__((unused)) double x) +double ADtwo_fun([[maybe_unused]] double x) { return 2.0; } diff --git a/src/df1b2-separable/df1b2gh.cpp b/src/df1b2-separable/df1b2gh.cpp index 58092a3f5..bb51a7086 100644 --- a/src/df1b2-separable/df1b2gh.cpp +++ b/src/df1b2-separable/df1b2gh.cpp @@ -22,7 +22,7 @@ */ double do_gauss_hermite_block_diagonal(const dvector& x, const dvector& u0,const dmatrix& Hess,const dvector& _xadjoint, - const dvector& _uadjoint, __attribute__((unused)) const dmatrix& _Hessadjoint, + const dvector& _uadjoint, [[maybe_unused]] const dmatrix& _Hessadjoint, function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) diff --git a/src/df1b2-separable/df1b2ghmult.cpp b/src/df1b2-separable/df1b2ghmult.cpp index 43e50e278..f1e07ee2d 100644 --- a/src/df1b2-separable/df1b2ghmult.cpp +++ b/src/df1b2-separable/df1b2ghmult.cpp @@ -22,7 +22,7 @@ */ double do_gauss_hermite_block_diagonal_multi(const dvector& x, const dvector& u0,const dmatrix& Hess,const dvector& _xadjoint, - const dvector& _uadjoint, __attribute__((unused)) const dmatrix& _Hessadjoint, + const dvector& _uadjoint, [[maybe_unused]] const dmatrix& _Hessadjoint, function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) diff --git a/src/df1b2-separable/df1b2im3.cpp b/src/df1b2-separable/df1b2im3.cpp index 91fbfa694..8fb03b2d6 100644 --- a/src/df1b2-separable/df1b2im3.cpp +++ b/src/df1b2-separable/df1b2im3.cpp @@ -22,7 +22,7 @@ */ double calculate_importance_sample_block_diagonal(const dvector& x, const dvector& u0,const dmatrix& Hess,const dvector& _xadjoint, - const dvector& _uadjoint, __attribute__((unused)) const dmatrix& _Hessadjoint, + const dvector& _uadjoint, [[maybe_unused]] const dmatrix& _Hessadjoint, function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) diff --git a/src/df1b2-separable/df1b2im3f.cpp b/src/df1b2-separable/df1b2im3f.cpp index 16c724492..211180724 100644 --- a/src/df1b2-separable/df1b2im3f.cpp +++ b/src/df1b2-separable/df1b2im3f.cpp @@ -22,7 +22,7 @@ */ double calculate_importance_sample_block_diagonal_funnel(const dvector& x, const dvector& u0,const dmatrix& Hess,const dvector& _xadjoint, - const dvector& _uadjoint, __attribute__((unused)) const dmatrix& _Hessadjoint, + const dvector& _uadjoint, [[maybe_unused]] const dmatrix& _Hessadjoint, function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) diff --git a/src/df1b2-separable/df1b2im4.cpp b/src/df1b2-separable/df1b2im4.cpp index a85f9e10f..17197c9e6 100644 --- a/src/df1b2-separable/df1b2im4.cpp +++ b/src/df1b2-separable/df1b2im4.cpp @@ -22,7 +22,7 @@ */ double calculate_importance_sample_block_diagonal_option2(const dvector& x, const dvector& u0,const dmatrix& Hess,const dvector& _xadjoint, - const dvector& _uadjoint, __attribute__((unused)) const dmatrix& _Hessadjoint, + const dvector& _uadjoint, [[maybe_unused]] const dmatrix& _Hessadjoint, function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) diff --git a/src/df1b2-separable/df1b2im5.cpp b/src/df1b2-separable/df1b2im5.cpp index 06aa47106..9ca5bd9f7 100644 --- a/src/df1b2-separable/df1b2im5.cpp +++ b/src/df1b2-separable/df1b2im5.cpp @@ -23,7 +23,7 @@ double calculate_importance_sample_block_diagonal_option_antithetical (const dvector& x,const dvector& u0,const dmatrix& Hess, const dvector& _xadjoint,const dvector& _uadjoint, - __attribute__((unused)) const dmatrix& _Hessadjoint,function_minimizer * pmin) + [[maybe_unused]] const dmatrix& _Hessadjoint,function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) ADUNCONST(dvector,uadjoint) diff --git a/src/df1b2-separable/df1b2impspf.cpp b/src/df1b2-separable/df1b2impspf.cpp index e4cbeb076..5c33e3c67 100644 --- a/src/df1b2-separable/df1b2impspf.cpp +++ b/src/df1b2-separable/df1b2impspf.cpp @@ -24,7 +24,7 @@ class dvar_hs_smatrix; */ double calculate_importance_sample_shess(const dvector& x,const dvector& u0, const dmatrix& Hess,const dvector& _xadjoint,const dvector& _uadjoint, - __attribute__((unused)) const dmatrix& _Hessadjoint,function_minimizer * pmin) + [[maybe_unused]] const dmatrix& _Hessadjoint,function_minimizer * pmin) { ADUNCONST(dvector,xadjoint) ADUNCONST(dvector,uadjoint) diff --git a/src/df1b2-separable/df1b2invcumdbeta.cpp b/src/df1b2-separable/df1b2invcumdbeta.cpp index 6ae9f096d..f91093de9 100644 --- a/src/df1b2-separable/df1b2invcumdbeta.cpp +++ b/src/df1b2-separable/df1b2invcumdbeta.cpp @@ -210,7 +210,7 @@ Press, Teukolsky, Vetterling, Flannery, chapter 2 */ df3_three_variable betai(const df3_three_variable& a, - const df3_three_variable& b,const df3_three_variable& x, __attribute__((unused)) int maxit) + const df3_three_variable& b,const df3_three_variable& x, [[maybe_unused]] int maxit) { df3_three_variable bt; @@ -226,7 +226,7 @@ } df3_three_variable betai(const df3_three_variable& a, - const df3_three_variable& b, double x, __attribute__((unused)) int maxit) + const df3_three_variable& b, double x, [[maybe_unused]] int maxit) { df3_three_variable bt; diff --git a/src/df1b2-separable/df1b2lap.cpp b/src/df1b2-separable/df1b2lap.cpp index 8f0cd560d..322928a56 100644 --- a/src/df1b2-separable/df1b2lap.cpp +++ b/src/df1b2-separable/df1b2lap.cpp @@ -60,7 +60,7 @@ dvar_vector * * \param */ dvector laplace_approximation_calculator::get_uhat_quasi_newton - (__attribute__((unused)) const dvector& x,function_minimizer * pfmin) + ([[maybe_unused]] const dvector& x,function_minimizer * pfmin) { std::ostream& output_stream = get_output_stream(); //int on,nopt; @@ -215,7 +215,7 @@ dvector laplace_approximation_calculator::get_uhat_quasi_newton * \param */ dvector laplace_approximation_calculator::get_uhat_lm_newton - (__attribute__((unused)) const dvector& x,function_minimizer * pfmin) + ([[maybe_unused]] const dvector& x,function_minimizer * pfmin) { double f=0.0; //dvector g(1,usize); @@ -324,8 +324,8 @@ laplace_approximation_calculator::laplace_approximation_calculator ( int _xsize, int _usize, - __attribute__((unused)) int _minder, - __attribute__((unused)) int _maxder, + [[maybe_unused]] int _minder, + [[maybe_unused]] int _maxder, function_minimizer* _pmin ): init_switch(1), @@ -1387,7 +1387,7 @@ void random_effects_userfunction(double f,const dvector& x, const dvector& g); * Description not yet available. * \param */ -void get_second_ders(__attribute__((unused)) int xs, __attribute__((unused)) int us,const init_df1b2vector _y,dmatrix& Hess, +void get_second_ders([[maybe_unused]] int xs, [[maybe_unused]] int us,const init_df1b2vector _y,dmatrix& Hess, dmatrix& Dux, df1b2_gradlist * f1b2gradlist,function_minimizer * pfmin, laplace_approximation_calculator * lpc) { @@ -1922,7 +1922,7 @@ double calculate_laplace_approximation(const dvector& x,const dvector& u0, * \param */ void get_newton_raphson_info(int xs,int us,const init_df1b2vector _y, - dmatrix& Hess, dvector& grad, __attribute__((unused)) df1b2_gradlist * f1b2gradlist, + dmatrix& Hess, dvector& grad, [[maybe_unused]] df1b2_gradlist * f1b2gradlist, function_minimizer * pfmin) { // Note that xs is the number of active non random effects @@ -1965,7 +1965,7 @@ void get_newton_raphson_info(int xs,int us,const init_df1b2vector _y, /** Does Nothing. */ -void laplace_approximation_calculator::check_for_need_to_reallocate(__attribute__((unused)) int ip) +void laplace_approximation_calculator::check_for_need_to_reallocate([[maybe_unused]] int ip) { } //void laplace_approximation_calculator::get_newton_raphson_info @@ -2811,7 +2811,7 @@ void nested_calls_indices::allocate(const nested_calls_shape& _nsc) * \param */ dvector laplace_approximation_calculator::get_uhat_lm_newton2 - (__attribute__((unused)) const dvector& x,function_minimizer * pfmin) + ([[maybe_unused]] const dvector& x,function_minimizer * pfmin) { std::ostream& output_stream = get_output_stream(); diff --git a/src/df1b2-separable/df1b2lme.cpp b/src/df1b2-separable/df1b2lme.cpp index a938c872b..dda558711 100644 --- a/src/df1b2-separable/df1b2lme.cpp +++ b/src/df1b2-separable/df1b2lme.cpp @@ -125,7 +125,7 @@ void laplace_approximation_calculator::get_hessian_components_banded_lme * \param */ dvar_matrix laplace_approximation_calculator::get_hessian_from_components_lme - (__attribute__((unused)) function_minimizer * pfmin) + ([[maybe_unused]] function_minimizer * pfmin) { int mmin=variance_components_vector->indexmin(); int mmax=variance_components_vector->indexmax(); diff --git a/src/df1b2-separable/df1b2lp1.cpp b/src/df1b2-separable/df1b2lp1.cpp index 2f769b26a..d7bf83775 100644 --- a/src/df1b2-separable/df1b2lp1.cpp +++ b/src/df1b2-separable/df1b2lp1.cpp @@ -853,7 +853,7 @@ void laplace_approximation_calculator::get_newton_raphson_info * Description not yet available. * \param */ -void laplace_approximation_calculator::set_u_dot(__attribute__((unused)) int ip) +void laplace_approximation_calculator::set_u_dot([[maybe_unused]] int ip) { int mmin=y.indexmin(); int mmax=y.indexmax(); diff --git a/src/df1b2-separable/df1b2lp11.cpp b/src/df1b2-separable/df1b2lp11.cpp index 2b8e95cf0..de1e81671 100644 --- a/src/df1b2-separable/df1b2lp11.cpp +++ b/src/df1b2-separable/df1b2lp11.cpp @@ -200,8 +200,8 @@ dvector safe_choleski_solver::solve \todo Needs testing */ void laplace_approximation_calculator:: - do_newton_raphson_state_space(function_minimizer * pfmin, __attribute__((unused)) double f_from_1, - __attribute__((unused)) int& no_converge_flag) + do_newton_raphson_state_space(function_minimizer * pfmin, [[maybe_unused]] double f_from_1, + [[maybe_unused]] int& no_converge_flag) { std::ostream& output_stream = get_output_stream(); diff --git a/src/df1b2-separable/df1b2lp2.cpp b/src/df1b2-separable/df1b2lp2.cpp index 87ee31a60..4e5a155b7 100644 --- a/src/df1b2-separable/df1b2lp2.cpp +++ b/src/df1b2-separable/df1b2lp2.cpp @@ -22,7 +22,7 @@ double calculate_laplace_approximation(const dvector& x,const dvector& u0, const dmatrix& Hess,const dvector& _xadjoint,const dvector& _uadjoint, const dmatrix& _Hessadjoint,function_minimizer * pmin); -static void xxx(__attribute__((unused)) ivector re_list, __attribute__((unused)) ivector fe_list){} +static void xxx([[maybe_unused]] ivector re_list, [[maybe_unused]] ivector fe_list){} /** * Description not yet available. diff --git a/src/df1b2-separable/df1b2lp8.cpp b/src/df1b2-separable/df1b2lp8.cpp index dac3b9f99..d6b637853 100644 --- a/src/df1b2-separable/df1b2lp8.cpp +++ b/src/df1b2-separable/df1b2lp8.cpp @@ -357,7 +357,7 @@ double fcomp1(dvector x,dvector d,int samplesize,int n,dvector & g, * Description not yet available. * \param */ -void laplace_approximation_calculator::check_hessian_type(__attribute__((unused)) const dvector& _x, +void laplace_approximation_calculator::check_hessian_type([[maybe_unused]] const dvector& _x, function_minimizer * pfmin) { pfmin->pre_user_function(); diff --git a/src/df1b2-separable/df1b2lp9.cpp b/src/df1b2-separable/df1b2lp9.cpp index ae644b157..2662a0a7a 100644 --- a/src/df1b2-separable/df1b2lp9.cpp +++ b/src/df1b2-separable/df1b2lp9.cpp @@ -31,7 +31,7 @@ typedef fmm* pfmm; * \param */ dvector laplace_approximation_calculator::get_uhat_quasi_newton_block_diagonal - (__attribute__((unused)) const dvector& x,function_minimizer * pfmin) + ([[maybe_unused]] const dvector& x,function_minimizer * pfmin) { if (separable_function_difference) { diff --git a/src/df1b2-separable/df1b2sumc.cpp b/src/df1b2-separable/df1b2sumc.cpp index f036748e8..c463ee05e 100644 --- a/src/df1b2-separable/df1b2sumc.cpp +++ b/src/df1b2-separable/df1b2sumc.cpp @@ -38,7 +38,7 @@ void ad_read_pass2_sumc(void); * Description not yet available. * \param */ - int df1b2_gradlist::write_pass1_sum(__attribute__((unused)) double x,const df1b2variable * _py, + int df1b2_gradlist::write_pass1_sum([[maybe_unused]] double x,const df1b2variable * _py, df1b2variable * pz) { ADUNCONST(df1b2variable*,py) diff --git a/src/df1b2-separable/df32fun.cpp b/src/df1b2-separable/df32fun.cpp index 272be19b4..e6fafb38a 100644 --- a/src/df1b2-separable/df32fun.cpp +++ b/src/df1b2-separable/df32fun.cpp @@ -449,7 +449,7 @@ int operator >(const df3_two_variable & x, const df3_two_variable & n) * Description not yet available. * \param */ -void set_derivatives( df3_two_variable& z,const df3_two_variable& x, __attribute__((unused)) double u, +void set_derivatives( df3_two_variable& z,const df3_two_variable& x, [[maybe_unused]] double u, double zp,double zp2,double zp3) { //*z.get_u() = u; diff --git a/src/df1b2-separable/df33fun.cpp b/src/df1b2-separable/df33fun.cpp index f8b6fea92..88df54940 100644 --- a/src/df1b2-separable/df33fun.cpp +++ b/src/df1b2-separable/df33fun.cpp @@ -487,7 +487,7 @@ df3_three_variable& df3_three_variable::operator+=(double value) * \param */ void set_derivatives(df3_three_variable& z,const df3_three_variable& x, - __attribute__((unused)) double u, double zp,double zp2,double zp3) + [[maybe_unused]] double u, double zp,double zp2,double zp3) { //*z.get_u() = u; diff --git a/src/df1b2-separable/df3gammp.cpp b/src/df1b2-separable/df3gammp.cpp index bad9913dc..344481ae0 100644 --- a/src/df1b2-separable/df3gammp.cpp +++ b/src/df1b2-separable/df3gammp.cpp @@ -155,7 +155,7 @@ df3_two_variable cumd_gamma(const df3_two_variable& x, } } df3_two_variable cumd_exponential(const df3_two_variable& x, - __attribute__((unused)) const df3_two_variable& a) + [[maybe_unused]] const df3_two_variable& a) { df3_two_variable tmp; if (value(x)<=0) diff --git a/src/df1b2-separable/f1b23d1.cpp b/src/df1b2-separable/f1b23d1.cpp index 50cfb1dca..5c62dc964 100644 --- a/src/df1b2-separable/f1b23d1.cpp +++ b/src/df1b2-separable/f1b23d1.cpp @@ -73,7 +73,7 @@ df1b23array::df1b23array(void) * \param */ void df1b23array::allocate(int nrl,int nrh,int ncl,int nch, - int nxl,int nxh, __attribute__((unused)) const char * s) + int nxl,int nxh, [[maybe_unused]] const char * s) { allocate(nrl,nrh,ncl,nch,nxl,nxh); } @@ -98,7 +98,7 @@ void df1b23array::allocate(int nrl,int nrh,const index_type& ncl, void df1b23array::allocate(int nrl,int nrh, const index_type& ncl, const index_type& nch, const index_type& nxl, const index_type& nxh, - __attribute__((unused)) const char * s) + [[maybe_unused]] const char * s) { allocate(nrl,nrh,ncl,nch,nxl,nxh); } @@ -222,7 +222,7 @@ void df1b23array::allocate( const int nrl, const int nrh, const ivector& ncl, const ivector& nch, const int nxl, const int nxh, - __attribute__((unused)) const char* s) + [[maybe_unused]] const char* s) { index_min=nrl; index_max=nrh; diff --git a/src/df1b2-separable/f1b2fnl6.cpp b/src/df1b2-separable/f1b2fnl6.cpp index 6e10def30..f655b2ac0 100644 --- a/src/df1b2-separable/f1b2fnl6.cpp +++ b/src/df1b2-separable/f1b2fnl6.cpp @@ -142,7 +142,7 @@ void funnel_init_df1b2matrix::set_index(imatrix& y,int& ii) * \param */ void funnel_init_df1b2matrix::set_value(const init_df1b2vector& _x, - const int& _ii, __attribute__((unused)) const df1b2variable& _pen) + const int& _ii, [[maybe_unused]] const df1b2variable& _pen) { ADUNCONST(int,ii) ADUNCONST(init_df1b2vector,x) diff --git a/src/df1b2-separable/f1b2lapqd.cpp b/src/df1b2-separable/f1b2lapqd.cpp index 7dac823cf..2c37f331a 100644 --- a/src/df1b2-separable/f1b2lapqd.cpp +++ b/src/df1b2-separable/f1b2lapqd.cpp @@ -25,7 +25,7 @@ double calculate_laplace_approximation(const dvector& x,const dvector& u0, * \param */ dvector laplace_approximation_calculator::get_uhat_quasi_newton_qd - (__attribute__((unused)) const dvector& x, __attribute__((unused)) function_minimizer * pfmin) + ([[maybe_unused]] const dvector& x, [[maybe_unused]] function_minimizer * pfmin) { dvector g(1,usize); independent_variables u(1,usize); diff --git a/src/df1b2-separable/f1b2lndt.cpp b/src/df1b2-separable/f1b2lndt.cpp index 7ae9c734e..b3d35ad85 100644 --- a/src/df1b2-separable/f1b2lndt.cpp +++ b/src/df1b2-separable/f1b2lndt.cpp @@ -152,7 +152,7 @@ df1b2matrix_pair::df1b2matrix_pair(const df1b2matrix& _a, const df1b2matrix& _b) : a(_a), b(_b) {} -void ludcmp(const df1b2matrix& M, __attribute__((unused)) int kludge) +void ludcmp(const df1b2matrix& M, [[maybe_unused]] int kludge) { // do lu decomp once to get ordering int mmin=M.indexmin(); @@ -296,7 +296,7 @@ df1b2matrix_pair ludcmp(const df1b2matrix& a) dmatrix reorder(const dmatrix& CM,ivector & indx); ivector getreindex(ivector & indx); -df1b2variable ln_det(const df1b2matrix& M, __attribute__((unused)) int & sgn) +df1b2variable ln_det(const df1b2matrix& M, [[maybe_unused]] int & sgn) { int mmin=M.indexmin(); int mmax=M.indexmax(); @@ -405,7 +405,7 @@ df1b2vector solve(df1b2matrix& M,df1b2vector& v,const df1b2variable& _ln_det) } df1b2vector solve(df1b2matrix& M,df1b2vector& v,const df1b2variable& _ln_det, - __attribute__((unused)) const int& sgn) + [[maybe_unused]] const int& sgn) { df1b2variable& ln_det = (df1b2variable&) _ln_det; int mmin=M.indexmin(); diff --git a/src/df1b2-separable/f1b2sol2.cpp b/src/df1b2-separable/f1b2sol2.cpp index 0e1cdc43b..5eb974b90 100644 --- a/src/df1b2-separable/f1b2sol2.cpp +++ b/src/df1b2-separable/f1b2sol2.cpp @@ -25,7 +25,7 @@ df1b2vector solve(const df1b2matrix& aa,const df1b2vector& z, const df1b2variable & ln_unsigned_det,double& sign); df1b2vector solve(const df1b2matrix& aa,const df1b2vector& z, - const df1b2variable& ld, __attribute__((unused)) df1b2variable& sign) + const df1b2variable& ld, [[maybe_unused]] df1b2variable& sign) { double sgn = 0; return solve(aa,z,ld,sgn); diff --git a/src/df1b2-separable/f1b2trst.cpp b/src/df1b2-separable/f1b2trst.cpp index af12ce9e6..3694756cb 100644 --- a/src/df1b2-separable/f1b2trst.cpp +++ b/src/df1b2-separable/f1b2trst.cpp @@ -17,7 +17,7 @@ * Description not yet available. * \param */ -void function_minimizer::trust_region_update(int nvar, __attribute__((unused)) int _crit, +void function_minimizer::trust_region_update(int nvar, [[maybe_unused]] int _crit, independent_variables& x,const dvector& _g,const double& _f) { double & f= (double&)_f; diff --git a/src/df1b2-separable/f1b2vc1.cpp b/src/df1b2-separable/f1b2vc1.cpp index d41092dcd..0bd68bbfd 100644 --- a/src/df1b2-separable/f1b2vc1.cpp +++ b/src/df1b2-separable/f1b2vc1.cpp @@ -636,7 +636,7 @@ void df1b2vector::allocate(void) * Description not yet available. * \param */ -void df1b2vector::allocate(int lb,int ub, __attribute__((unused)) const char * s) +void df1b2vector::allocate(int lb,int ub, [[maybe_unused]] const char * s) { allocate(lb,ub); } @@ -830,7 +830,7 @@ df1b2vector::df1b2vector(const predf1b2vector& pdv) * Description not yet available. * \param */ - void ADMB_getcallindex(__attribute__((unused)) const df1b2variable& x) + void ADMB_getcallindex([[maybe_unused]] const df1b2variable& x) { cout << "HERE" << endl; } @@ -839,7 +839,7 @@ df1b2vector::df1b2vector(const predf1b2vector& pdv) * Description not yet available. * \param */ - void ADMB_getcallindex(__attribute__((unused)) const df1b2vector& x) + void ADMB_getcallindex([[maybe_unused]] const df1b2vector& x) { cout << "HERE" << endl; } @@ -848,7 +848,7 @@ df1b2vector::df1b2vector(const predf1b2vector& pdv) * Description not yet available. * \param */ - void ADMB_getcallindex(__attribute__((unused)) const df1b2matrix& x) + void ADMB_getcallindex([[maybe_unused]] const df1b2matrix& x) { cout << "HERE" << endl; } diff --git a/src/df1b2-separable/f1b2vc5.cpp b/src/df1b2-separable/f1b2vc5.cpp index a0143d6ee..ddc875915 100644 --- a/src/df1b2-separable/f1b2vc5.cpp +++ b/src/df1b2-separable/f1b2vc5.cpp @@ -641,7 +641,7 @@ df1b2matrix::df1b2matrix(void) * Description not yet available. * \param */ -void df1b2matrix::allocate(int nrl,int nrh,int ncl,int nch, __attribute__((unused)) const char * s) +void df1b2matrix::allocate(int nrl,int nrh,int ncl,int nch, [[maybe_unused]] const char * s) { allocate(nrl,nrh,ncl,nch); } @@ -651,7 +651,7 @@ void df1b2matrix::allocate(int nrl,int nrh,int ncl,int nch, __attribute__((unuse * \param */ void df1b2matrix::allocate(int nrl,int nrh,const index_type& ncl, - const index_type& nch, __attribute__((unused)) const char * s) + const index_type& nch, [[maybe_unused]] const char * s) { allocate(nrl,nrh,ncl,nch); } diff --git a/src/df1b2-separable/fquadpri.cpp b/src/df1b2-separable/fquadpri.cpp index 54d14d1b6..fe7124d89 100644 --- a/src/df1b2-separable/fquadpri.cpp +++ b/src/df1b2-separable/fquadpri.cpp @@ -127,12 +127,12 @@ df1b2quadratic_prior::~df1b2quadratic_prior(void) } void df1b2quadratic_prior::allocate(const df1b2_init_vector& _u, - __attribute__((unused)) const char* s) + [[maybe_unused]] const char* s) { allocate(_u); } void df1b2quadratic_prior::allocate(const df1b2matrix & _M, - const df1b2_init_vector & _u, __attribute__((unused)) const char * s) + const df1b2_init_vector & _u, [[maybe_unused]] const char * s) { allocate(_M,_u); } @@ -316,11 +316,11 @@ void constant_df1b2quadratic_re_penalty::set_old_style_flag(void) { old_style_flag=2; } -void constant_df1b2quadratic_re_penalty::operator = (__attribute__((unused)) const dmatrix & M) +void constant_df1b2quadratic_re_penalty::operator = ([[maybe_unused]] const dmatrix & M) { //df1b2quadratic_prior::operator = (M); } -void df1b2quadratic_prior::operator = (__attribute__((unused)) const dmatrix & M) +void df1b2quadratic_prior::operator = ([[maybe_unused]] const dmatrix & M) { quadratic_prior::in_qp_calculations=0; num_active_parameters=funnel_init_var::num_vars; diff --git a/src/df1b2-separable/quadpri.cpp b/src/df1b2-separable/quadpri.cpp index c8a815443..b75a4f495 100644 --- a/src/df1b2-separable/quadpri.cpp +++ b/src/df1b2-separable/quadpri.cpp @@ -496,7 +496,7 @@ quadratic_prior::~quadratic_prior() * Description not yet available. * \param */ - void quadratic_prior::allocate( const dvar_vector & _u, __attribute__((unused)) const char * s) + void quadratic_prior::allocate( const dvar_vector & _u, [[maybe_unused]] const char * s) { allocate(_u); } @@ -521,7 +521,7 @@ quadratic_prior::~quadratic_prior() * \param */ void quadratic_prior::allocate(const dvar_matrix & _M, - const dvar_vector & _u, __attribute__((unused)) const char * s) + const dvar_vector & _u, [[maybe_unused]] const char * s) { allocate(_M,_u); }