Uninitialized variable in profile.c

Berthold Stoeger bstoeger at mail.tuwien.ac.at
Sun Dec 17 05:19:55 PST 2017


Hi Rick,

In current master, gcc produces an uninitialized variable warning in profile.c, 
which seems correct to me.

In l.1044 last_ceiling is compared to first_ceiling, but last_ceilng is set 
first in l.1056. I guess decoMode() cannot change in this function, so gcc's 
analysis seems correct.

There is another warning concerning entry in l.807. To make the warning go 
away, you could add a
  if (pi->nr <= 0)
    return;
block before the loop. Even if pi->nr can never be <= 0, this seems like a 
good idea for robustness' sake.

Berthold 


More information about the subsurface mailing list