nushoin / RTree

N-dimensional RTree implementation in C++
Other
375 stars 107 forks source link

Warning in PickBranch #15

Open benstadin opened 5 years ago

benstadin commented 5 years ago

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

AlexVonB commented 5 years ago

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

yabadabu commented 3 years ago

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;