Skip to content

Commit e028b29

Browse files
committed
Fix uninitialized variables
1 parent 28e6857 commit e028b29

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/bobyqa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ bobyqb(const INTEGER n, const INTEGER npt, const context* ctx,
595595
/* Set uninitialized variables to avoid compiler warnings. */
596596
adelt = zero;
597597
alpha = zero;
598+
beta = zero;
598599
cauchy = zero;
599600
denom = zero;
600601
diff = zero;

src/newuoa.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,10 @@ newuoa_optimize(INTEGER n, INTEGER npt, bool maximize, newuoa_objfun* objfun, vo
825825

826826
#else
827827

828+
/* Initialize local variables. */
829+
xipt = zero;
830+
xjpt = zero;
831+
828832
/* Check arguments. */
829833
if (n < 2) {
830834
if (iprint > 0) {

0 commit comments

Comments
 (0)