aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparse.1
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-09-30 23:05:16 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-01 00:45:21 +0200
commit1a88f2f24619e7a93aaef917fc72eba71706c9df (patch)
tree03d41386a00e539281647d67562b0343f6142bd2 /sparse.1
parent58721d6e25e1845ce147150755e61401fcbc1a32 (diff)
downloadsparse-dev-1a88f2f24619e7a93aaef917fc72eba71706c9df.tar.gz
flex-array: warn when using sizeof() on a flexible array
Using sizeof() on a structure containing a flexible array will ignore the 'flexible' part. This is maybe what is expected but maybe not, so add an option -Wflexible-array-sizeof to warn on such usage. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.1')
-rw-r--r--sparse.17
1 files changed, 7 insertions, 0 deletions
diff --git a/sparse.1 b/sparse.1
index 48dab7a9..5f98df33 100644
--- a/sparse.1
+++ b/sparse.1
@@ -257,6 +257,13 @@ Sparse issues these warnings by default. To turn them off, use
\fB\-Wno\-external\-function\-has\-definition\fR.
.
.TP
+.B -Wflexible-array-sizeof
+Warn about using the sizeof operator on a structure containing a flexible array,
+possibly recursively.
+
+Sparse does not issue these warnings by default.
+.
+.TP
.B \-Winit\-cstring
Warn about initialization of a char array with a too long constant C string.