摘录


 53 Getting sparse
 54 ~~~~~~~~~~~~~~
 55 
 56 You can get latest released versions from the Sparse homepage at
 57 http://www.kernel.org/pub/linux/kernel/people/josh/sparse/
 58 
 59 Alternatively, you can get snapshots of the latest development version
 60 of sparse using git to clone..
 61 
 62         git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git
 63 
 64 DaveJ has hourly generated tarballs of the git tree available at..
 65 
 66         http://www.codemonkey.org.uk/projects/git-snapshots/sparse/
 67 
 68 
 69 Once you have it, just do
 70 
 71         make
 72         make install
 73 
 74 as a regular user, and it will install sparse in your ~/bin directory.
 75 
 76 Using sparse
 77 ~~~~~~~~~~~~
 78 
 79 Do a kernel make with "make C=1" to run sparse on all the C files that get
 80 recompiled, or use "make C=2" to run sparse on the files whether they need to
 81 be recompiled or not.  The latter is a fast way to check the whole tree if you
 82 have already built it.
 83 
 84 The optional make variable CF can be used to pass arguments to sparse.  The
 85 build system passes -Wbitwise to sparse automatically.  To perform endianness
 86 checks, you may define CHECK_ENDIAN:
 87 
 88         make C=2 CF="-DCHECK_ENDIAN"
 89 

点评

对你的内核代码做一下静态检查吧~

原文

点击这里查看原文

其它

本帖内容由21QA云收藏工具自动生成,欢迎使用。

系统消息 若觉得内容不错,请点击左上角的"赞"图标,以优化网站的内容呈现。 另外,请及时验证注册邮箱,否则收不到21QA发出的红包。 官方Q群:250203055

asked 15 Apr '15, 08:59

%E8%B7%AF%E4%BA%BA%E7%94%B2's gravatar image

路人甲
131598710886

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link: [text](http://url.com/ "title")
  • image: ![alt](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×885
×325
×85
×1

question asked: 15 Apr '15, 08:59

question was seen: 826 times

last updated: 15 Apr '15, 08:59

powered by O*S*Q*A

粤ICP备14040061号-1