On 10/5/19 3:07 AM, Akim Demaille wrote:
This is a bug in Clang, as both operands of ? are ptrdiff_t. You might try
filing a bug report with the Clang folks.
Maybe the error in actually in the division by the unsigned and the diagnostic is wrong.
Although that's possible, it'd still be a Clang bug. There should be no
diagnostic for arithmetic on constants where the result is mathematically
correct. GCC generally gets this right.
My experience in other projects is that we don't have time to maintain
workarounds for Clang warning bugs (or for warning bugs in old GCCs, for that
matter). But if you want to take on the task,....