commit | d6d5ef2f0d371fa5b4c74ff119d6d44a11bbac2e | [log] [tgz] |
---|---|---|
author | Alfred Klomp <git@alfredklomp.com> | Mon Jul 14 22:32:21 2014 +0200 |
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | Thu Oct 23 15:36:33 2014 +0200 |
tree | fedfe6258dae5913c82a6a50095f3ba4e4092a39 | |
parent | 9afec5f8ec792e733e5b2217eb71e4f54955460c [diff] |
timing.c: avoid referencing garbage value Found with Clang's `scan-build` tool. When get_timer() is called with `reset` set to 1, the value of t->start.tv_sec is used as a rvalue without being initialized first. This is relatively harmless because the result of get_timer() is not used by the callers when called in "reset mode". However, scan-build prints a warning. Silence the warning by only calculating the delta on non-reset runs, returning zero otherwise.