diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-09-30 23:05:16 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-01 00:45:21 +0200 |
| commit | 1a88f2f24619e7a93aaef917fc72eba71706c9df (patch) | |
| tree | 03d41386a00e539281647d67562b0343f6142bd2 /sparse.1 | |
| parent | 58721d6e25e1845ce147150755e61401fcbc1a32 (diff) | |
| download | sparse-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.1 | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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. |
