Skip to content

Suppress division by zero warning

Tony Finch requested to merge 3582-coverity-bench-siphash into main

Coverity is optimistic that we might do thousands of hashes in less than a microsecond.

/tests/bench/siphash.c: 54 in main()
48     			count++;
49     		}
50
51     		isc_time_now_hires(&finish);
52
53     		us = isc_time_microdiff(&finish, &start);
>>>     CID 358309:  Integer handling issues  (DIVIDE_BY_ZERO)
>>>     In expression "count * 1000UL / us", division by expression "us" which may be zero has undefined behavior.
54     		printf("%f us wide-lower len %3zu, %7llu kh/s (%llx)\n",
55     		       (double)us / 1000000.0, len,
56     		       (unsigned long long)(count * 1000 / us),
57     		       (unsigned long long)sum);
58     	}
59

Closes #3582 (closed)

Merge request reports