From bb45d7721419523fc2adc94a0d04105a5c5f3d42 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Thu, 24 Aug 2017 10:38:35 +0200 Subject: [PATCH] avoid initializing global variable with HUGE_VAL --- test/testopt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/testopt.c b/test/testopt.c index 147882c..5625d85 100644 --- a/test/testopt.c +++ b/test/testopt.c @@ -48,7 +48,7 @@ extern "C" int feenableexcept (int EXCEPTS); #include "testfuncs.h" static nlopt_algorithm algorithm = NLOPT_GN_DIRECT_L; -static double ftol_rel = 0, ftol_abs = 0, xtol_rel = 0, xtol_abs = 0, minf_max_delta = -HUGE_VAL; +static double ftol_rel = 0, ftol_abs = 0, xtol_rel = 0, xtol_abs = 0, minf_max_delta; static int maxeval = 1000, iterations = 1, center_start = 0; static double maxtime = 0.0; static double xinit_tol = -1; @@ -298,7 +298,8 @@ int main(int argc, char **argv) nlopt_srand_time(); testfuncs_verbose = 0; - + minf_max_delta = -HUGE_VAL; + if (argc <= 1) usage(stdout); -- 2.30.2