RTree icon indicating copy to clipboard operation
RTree copied to clipboard

Warning in PickBranch

Open benstadin opened this issue 5 years ago • 2 comments

There is a warning in Pickbranch:

Variable 'bestArea' may be uninitialized when used here

at line:

else if ((increase == bestIncr) && (area < bestArea))

Best regards Ben

benstadin avatar Jul 09 '19 16:07 benstadin

Hi Ben,

I added -Wall -Wpedantic -Wextra to the compiler call, but your warning did not appear (but I fixed some others: b45759b08016910ac8ef132340c882f3ba3805d1). What setup do you use?

Best Alex

AlexVonB avatar Jul 12 '19 09:07 AlexVonB

Appeared to me using Visual C++ 2019 under Debug builds. It's a false positive, but you can silent it by initializing to some value:

ELEMTYPEREAL bestArea = (ELEMTYPEREAL)-1;

yabadabu avatar Apr 11 '21 22:04 yabadabu