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

Side by Side Diff: docs/retrieving_code_analysis_warnings.md

Issue 1324603002: [Docs] Another round of stylistic fixes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « docs/proxy_auto_config.md ('k') | docs/script_preprocessor.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Introduction 1 # Retrieving Code Analysis Warnings
2 2
3 Several times a day the Chromium code base is built with Microsoft VC++'s /analy ze compile option. This does static code analysis which has found numerous bugs (see https://code.google.com/p/chromium/issues/detail?id=427616). While it is po ssible to visit the /analyze builder page and look at the raw results (http://bu ild.chromium.org/p/chromium.fyi/builders/Chromium%20Windows%20Analyze) this work s very poorly. 3 Several times a day the Chromium code base is built with Microsoft VC++'s
4 `/analyze` compile option. This does static code analysis which has found
5 numerous bugs (see https://crbug.com/427616). While it is possible to visit the
6 `/analyze` builder page and look at the raw results
7 (http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Windows%20Analyze)
8 this works very poorly.
4 9
5 As of this writing there are 2,702 unique warnings. Some of these are in header files and fire multiple times so there are a total of 11,202 warning lines. Most of these have been examined and found to be false positives. Therefore, in orde r to sanely examine the /analyze warnings it is necessary to summarize the warni ngs, and find what is new. 10 As of this writing there are 2,702 unique warnings. Some of these are in header
11 files and fire multiple times so there are a total of 11,202 warning lines. Most
12 of these have been examined and found to be false positives. Therefore, in order
13 to sanely examine the /analyze warnings it is necessary to summarize the
14 warnings, and find what is new.
6 15
7 There are scripts to do this. 16 There are scripts to do this.
8 17
9 # Details 18 ## Details
10 19
11 The necessary scripts, which currently run on Windows only, are checked in to to ols\win\new\_analyze\_warnings. Typical usage is like this: 20 The necessary scripts, which currently run on Windows only, are checked in to
21 `tools\win\new_analyze_warnings`. Typical usage is like this:
12 22
13 ``` 23 > set ANALYZE_REPO=d:\src\analyze_chromium
14 > set ANALYZE_REPO=d:\src\analyze_chromium 24 > retrieve_latest_warnings.bat
15 > retrieve_latest_warnings.bat
16 ```
17 25
18 The batch file using the associated Python scripts to retrieve the latest result s from the web page, create a summary file, and if previous results were found c reate a new warnings file. Typical results look like this: 26 The batch file using the associated Python scripts to retrieve the latest
27 results from the web page, create a summary file, and if previous results were
28 found create a new warnings file. Typical results look like this:
19 29
20 ``` 30 analyze0067_full.txt
21 analyze0067_full.txt 31 analyze0067_summary.txt
22 analyze0067_summary.txt 32 analyze0067_new.txt
23 analyze0067_new.txt
24 ```
25 33
26 If ANALYZE\_REPO is set then the batch file goes to %ANALYZE\_REPO%\src, does a git pull, then does a checkout of the revision that corresponds to the latest wa rnings, and then does a gclient sync. The warnings can then be easily correlated to the specific source that triggered them. 34 If `ANALYZE_REPO` is set then the batch file goes to `%ANALYZE_REPO%\src`, does
35 a git pull, then does a checkout of the revision that corresponds to the latest
36 warnings, and then does a gclient sync. The warnings can then be easily
37 correlated to the specific source that triggered them.
27 38
28 # Understanding the results 39 ## Understanding the results
29 40
30 The new.txt file lists new warnings, and fixed warnings. Usually it can accurate ly identify them but sometimes all it can say is that the number of instances of a particularly warning has changed, which is usually not of interest. If you lo ok at new warnings every day or two then the number of new warnings is usually l ow enough to be quite manageable. 41 The `new.txt` file lists new warnings, and fixed warnings. Usually it can
42 accurately identify them but sometimes all it can say is that the number of
43 instances of a particularly warning has changed, which is usually not of
44 interest. If you look at new warnings every day or two then the number of new
45 warnings is usually low enough to be quite manageable.
31 46
32 The summary.txt file groups warnings by type, and then sorts the groups by frequ ency. Low frequency warnings are more likely to be real bugs, so focus on those. However, all of the low-frequency have been investigated so at this time they a re unlikely to be real bugs. 47 The `summary.txt` file groups warnings by type, and then sorts the groups by
48 frequency. Low frequency warnings are more likely to be real bugs, so focus on
49 those. However, all of the low-frequency have been investigated so at this time
50 they are unlikely to be real bugs.
33 51
34 The majority of new warnings are variable shadowing warnings. Until -Wshadow is enabled for gcc/clang builds these warnings will continue to appear, and unless they are actually buggy or are particularly confusing it is usually not worth fi xing them. One exception would be if you are planning to enable -Wshadow in whic h case using the list or relevant shadowing warnings would be ideal. 52 The majority of new warnings are variable shadowing warnings. Until `-Wshadow`
53 is enabled for gcc/clang builds these warnings will continue to appear, and
54 unless they are actually buggy or are particularly confusing it is usually not
55 worth fixing them. One exception would be if you are planning to enable
56 `-Wshadow` in which case using the list or relevant shadowing warnings would be
57 ideal.
35 58
36 Some of the warnings say that out-of-range memory accesses will occur, which is pretty scary. For instance "warning C6201: Index '-1' is out of valid index rang e '0' to '4'". In most cases these are false positives so use your own judgment when deciding whether to fix them. 59 Some of the warnings say that out-of-range memory accesses will occur, which is
60 pretty scary. For instance "warning C6201: Index '-1' is out of valid index
61 range '0' to '4'". In most cases these are false positives so use your own
62 judgment when deciding whether to fix them.
37 63
38 The full.txt file contains the raw output and should usually be ignored. 64 The `full.txt` file contains the raw output and should usually be ignored.
39 65
40 If you have any questions then post to the chromium dev mailing list. 66 If you have any questions then post to the chromium dev mailing list.
OLDNEW
« no previous file with comments | « docs/proxy_auto_config.md ('k') | docs/script_preprocessor.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698