Commit e83319510b04dd51a60da8a0b4ccf8b92b3ab1ad
Committed by
Linus Torvalds
1 parent
eefe85ee35
Exists in
master
and in
7 other branches
[PATCH] docs: update sparse.txt with CHECK_ENDIAN
Update the sparse documentation to omit the -Wbitwise flag example (as it is now passed by default), and document the kernel defines to enable endianness checking. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 21 additions and 15 deletions Side-by-side Diff
Documentation/sparse.txt
1 | 1 | Copyright 2004 Linus Torvalds |
2 | 2 | Copyright 2004 Pavel Machek <pavel@suse.cz> |
3 | +Copyright 2006 Bob Copeland <me@bobcopeland.com> | |
3 | 4 | |
4 | 5 | Using sparse for typechecking |
5 | 6 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
6 | 7 | |
7 | 8 | |
... | ... | @@ -41,23 +42,16 @@ |
41 | 42 | vs cpu-endian vs whatever), and there the constant "0" really _is_ |
42 | 43 | special. |
43 | 44 | |
44 | -Use | |
45 | +Getting sparse | |
46 | +~~~~~~~~~~~~~~ | |
45 | 47 | |
46 | - make C=[12] CF=-Wbitwise | |
47 | - | |
48 | -or you don't get any checking at all. | |
49 | - | |
50 | - | |
51 | -Where to get sparse | |
52 | -~~~~~~~~~~~~~~~~~~~ | |
53 | - | |
54 | 48 | With git, you can just get it from |
55 | 49 | |
56 | 50 | rsync://rsync.kernel.org/pub/scm/devel/sparse/sparse.git |
57 | 51 | |
58 | 52 | and DaveJ has tar-balls at |
59 | 53 | |
60 | - http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ | |
54 | + http://www.codemonkey.org.uk/projects/git-snapshots/sparse/ | |
61 | 55 | |
62 | 56 | |
63 | 57 | Once you have it, just do |
... | ... | @@ -65,9 +59,21 @@ |
65 | 59 | make |
66 | 60 | make install |
67 | 61 | |
68 | -as your regular user, and it will install sparse in your ~/bin directory. | |
69 | -After that, doing a kernel make with "make C=1" will run sparse on all the | |
70 | -C files that get recompiled, or with "make C=2" will run sparse on the | |
71 | -files whether they need to be recompiled or not (ie the latter is fast way | |
72 | -to check the whole tree if you have already built it). | |
62 | +as a regular user, and it will install sparse in your ~/bin directory. | |
63 | + | |
64 | +Using sparse | |
65 | +~~~~~~~~~~~~ | |
66 | + | |
67 | +Do a kernel make with "make C=1" to run sparse on all the C files that get | |
68 | +recompiled, or use "make C=2" to run sparse on the files whether they need to | |
69 | +be recompiled or not. The latter is a fast way to check the whole tree if you | |
70 | +have already built it. | |
71 | + | |
72 | +The optional make variable CF can be used to pass arguments to sparse. The | |
73 | +build system passes -Wbitwise to sparse automatically. To perform endianness | |
74 | +checks, you may define __CHECK_ENDIAN__: | |
75 | + | |
76 | + make C=2 CF="-D__CHECK_ENDIAN__" | |
77 | + | |
78 | +These checks are disabled by default as they generate a host of warnings. |