diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-29 00:35:44 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-09-01 22:41:24 +0200 |
| commit | d96da358cfa0432f067a4e66940765883b80ee62 (patch) | |
| tree | e11005607bf311160dbd3ae033abe44be1f1fe20 /sparse.1 | |
| parent | 4fd434fd65a494592fef81937254ba89c9ae6546 (diff) | |
| download | sparse-dev-d96da358cfa0432f067a4e66940765883b80ee62.tar.gz | |
stricter warning for explicit cast to ulong
sparse issues a warning when user pointers are casted to integer
types except to unsigned longs which are explicitly allowed.
However it may happen that we would like to also be warned
on casts to unsigned long.
Fix this by adding a new warning flag: -Wcast-from-as (to mirrors
-Wcast-to-as) which extends -Waddress-space to all casts that
remove an address space attribute (without using __force).
References: https://lore.kernel.org/lkml/20180628102741.vk6vphfinlj3lvhv@armageddon.cambridge.arm.com/
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.1')
| -rw-r--r-- | sparse.1 | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -77,6 +77,15 @@ Sparse issues these warnings by default. To turn them off, use \fB\-Wno\-bitwise\fR. . .TP +.B \-Wcast\-from\-as +Warn about which remove an address space to a pointer type. + +This is similar to \fB\-Waddress\-space\fR but will also warn +on casts to \fBunsigned long\fR. + +Sparse does not issues these warnings by default. +. +.TP .B \-Wcast\-to\-as Warn about casts which add an address space to a pointer type. |
