Commit 01090a7
committed
Fix warning C4018: '<': signed/unsigned mismatch
Again, `(_Urng::max) () - (_Urng::min) ()` is `result_type - result_type`, subject to the usual arithmetic conversions.
When compared against `_Udiff _Bmask_local`, this can emit signed/unsigned mismatch warnings.
(This repro is x86-specific because MSVC emits warning C4018 at level 3 for `int < unsigned int`.
`int < unsigned long long` emits an off-by-default warning C4388 "signed/unsigned mismatch".
So even though the warning behavior is architecture-neutral,
the varying size of `_Udiff` causes the warning to be x86-specific.)
I'm avoiding extracting the `max - min` as a constant to avoid VSO-2580691 "`/analyze` emits bogus warning C6295 (Loop executes infinitely) for a loop that immediately finishes".1 parent fedbd6c commit 01090a7
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6112 | 6112 | | |
6113 | 6113 | | |
6114 | 6114 | | |
6115 | | - | |
| 6115 | + | |
6116 | 6116 | | |
6117 | 6117 | | |
6118 | 6118 | | |
| |||
0 commit comments