Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Issue 872673007: Disable the noisiest /analyze warning in Chrome. ~3,700/12,000 (Closed)

Created:
5 years, 10 months ago by brucedawson
Modified:
5 years, 10 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Disable the noisiest /analyze warning in Chrome. ~3,700/12,000 Decades ago Intel decided that the bsr (Bit Scan Reverse) instruction should have undefined results if its argument is zero. This probably makes the instruction harder to implement and it definitely makes it more difficult to use. In SkCLZ_portable it requires a check for a zero argument, but despite that check /analyze still warns that _BitScanReverse might fail (because it doesn't know what can cause failures). Because this warning occurs in a frequently included header file it ends up being very noisy, accounting for ~30% of all warnings (before deduplication). Suppressing this useless warning will make the raw results easier to look through. Committed: https://skia.googlesource.com/skia/+/aea85dc3d332c963f5b85460036951ae3386683a

Patch Set 1 #

Total comments: 4

Patch Set 2 : Use warning(suppress instead of warning(disable for tighter scoping. #

Patch Set 3 : Added comment. #

Total comments: 1

Patch Set 4 : Remove _PREFAST_ check. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M include/core/SkMath.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (5 generated)
brucedawson
It would be nice to suppress this warning. The noisiness of this warning can be ...
5 years, 10 months ago (2015-01-29 22:25:45 UTC) #2
reed1
seems fine to me. adding mike/ben
5 years, 10 months ago (2015-01-30 14:03:52 UTC) #4
bungeman-skia
https://codereview.chromium.org/872673007/diff/1/include/core/SkMath.h File include/core/SkMath.h (right): https://codereview.chromium.org/872673007/diff/1/include/core/SkMath.h#newcode85 include/core/SkMath.h:85: #pragma warning(disable: 6102) // Using 'index' from failed function ...
5 years, 10 months ago (2015-01-30 15:49:22 UTC) #5
mtklein
I guess there's no way to communicate up to /analyze that it's not zero? __assume() ...
5 years, 10 months ago (2015-01-30 16:07:55 UTC) #6
brucedawson
Thanks for the comments. I've addressed them. Regarding telling /analyze that the input is definitely ...
5 years, 10 months ago (2015-01-30 17:38:06 UTC) #7
mtklein
lgtm
5 years, 10 months ago (2015-01-30 18:09:37 UTC) #8
bungeman-skia
https://codereview.chromium.org/872673007/diff/40001/include/core/SkMath.h File include/core/SkMath.h (right): https://codereview.chromium.org/872673007/diff/40001/include/core/SkMath.h#newcode84 include/core/SkMath.h:84: #ifdef _PREFAST_ // /analyze enabled I took a look, ...
5 years, 10 months ago (2015-01-30 18:10:54 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/872673007/40001
5 years, 10 months ago (2015-01-30 18:11:57 UTC) #11
commit-bot: I haz the power
Presubmit check for 872673007-40001 failed and returned exit status 1. Running presubmit commit checks ...
5 years, 10 months ago (2015-01-30 18:12:00 UTC) #13
reed1
Do you think we can eliminate the check for PREFAST?
5 years, 10 months ago (2015-01-30 18:22:21 UTC) #14
brucedawson
That depends on what compilers you support. VC++ 2010 and below do not support /analyze ...
5 years, 10 months ago (2015-01-30 18:24:22 UTC) #15
bungeman-skia
On 2015/01/30 18:24:22, brucedawson wrote: > That depends on what compilers you support. > > ...
5 years, 10 months ago (2015-01-30 19:36:39 UTC) #16
brucedawson
Thanks for doing that test. I had no easy way to do that. With those ...
5 years, 10 months ago (2015-01-30 19:49:43 UTC) #17
reed1
lgtm
5 years, 10 months ago (2015-01-30 20:20:01 UTC) #18
bungeman-skia
lgtm
5 years, 10 months ago (2015-01-30 20:46:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/872673007/60001
5 years, 10 months ago (2015-01-30 20:46:48 UTC) #21
commit-bot: I haz the power
5 years, 10 months ago (2015-01-30 20:57:53 UTC) #22
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://skia.googlesource.com/skia/+/aea85dc3d332c963f5b85460036951ae3386683a

Powered by Google App Engine
This is Rietveld 408576698