Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gettime: silence sanitizer overflow warning
A warning is triggered in clang's unsigned integer sanitizer while two seq values are subtracted from each other during the clock_cmp qsort comparator: gettime.c:657:17: runtime error: unsigned integer overflow: 2 - 3 cannot be represented in type 'unsigned int' While pedantically correct, the issue is harmless since the result is ultimately cast into a (signed) int on the function's return thus it will be interpreted correctly within qsort. However it's easy to silence the warning by changing clock_entry.seq from a uint32_t to a int32_t so even though we've reduced the range we hopefully make it easier to see and diagnose real overflow issues sooner in the future. Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
- Loading branch information