aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse.1
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-05-25 15:51:35 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-06-15 10:03:49 +0200
commitbcfe020ed939fa1e8474efaf31a86d80d0e5c5fe (patch)
treebf64a743ac1bc930757ac0198df845f544a13202 /sparse.1
parent6081052837c130ef4875a993a8034c9520e4c0ef (diff)
downloadsparse-dev-bcfe020ed939fa1e8474efaf31a86d80d0e5c5fe.tar.gz
add support for -fmemcpy-max-count
By default, sparse will warn if memcpy() (or memset(), copy_from_user(), copy_to_user()) is called with a very large static byte-count. But the limit is currently fixed at 100000, which may be fine for some uses but not for others. For example, this value is too low for sparse to be used on the git tree where, for example, some array used to sort the index is cleared with memset(). Change this by making the limit configurable via a new flag: -fmemcpy-max-count. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.1')
-rw-r--r--sparse.19
1 files changed, 9 insertions, 0 deletions
diff --git a/sparse.1 b/sparse.1
index df3c7f44..b79c5876 100644
--- a/sparse.1
+++ b/sparse.1
@@ -216,6 +216,9 @@ Warn about call of \fBmemcpy()\fR, \fBmemset()\fR, \fBcopy_from_user()\fR, or
Sparse issues these warnings by default. To turn them off, use
\fB\-Wno\-memcpy\-max\-count\fR.
+
+The limit can be changed with \fB\-fmemcpy\-max\-count=COUNT\fR,
+the default being \fB100000\fR.
.
.TP
.B \-Wnon\-pointer\-null
@@ -364,6 +367,12 @@ Report some statistics about memory allocation used by the tool.
.
.SH OTHER OPTIONS
.TP
+.B \-fmemcpy-max-count=COUNT
+Set the limit for the warnings given by \fB-Wmemcpy-max-count\fR.
+A COUNT of 0, useless in itself, will effectively disable the warning.
+The default limit is 100000.
+.
+.TP
.B \-ftabstop=WIDTH
Set the distance between tab stops. This helps sparse report correct
column numbers in warnings or errors. If the value is less than 1 or