commit | b308dd72d90d7464a4824ffd7d1284c7e046bbc4 | [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 Aug 14 11:34:35 2014 +0200 |
tree | 1bd234b727300ee20325a4aef095a14794868ec0 | |
parent | 7ee55624fb3f4ac2057f66f00bd6a3cf9d50dccb [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.