diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-12 22:26:28 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-17 00:38:46 +0200 |
| commit | 8b3cbf54ad42c68f5ea2fa5bc2cef5ce9e608571 (patch) | |
| tree | d415ba8c9847ce463b0f967878d663737f6e9084 /sparse.1 | |
| parent | 8b5d92da3b1919f574decb542d93fde82693fe71 (diff) | |
| download | sparse-dev-8b3cbf54ad42c68f5ea2fa5bc2cef5ce9e608571.tar.gz | |
union-cast: teach sparse about union casts
A cast to union type is a GCC extension similar to a compound
literal just for union, using the syntax of a cast.
However, sparse doesn't know about them and treats them like
other casts to non-scalars.
So, teach sparse about them, convert them to the corresponding
compound literal and add a warning flag to enable/disable the
associated warning: -W[no-]union-cast.
Note: a difference between union casts and compound literals
is that the union casts yield rvalues while compound
literals are lvalues but this distinction is not yet done
in this series.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'sparse.1')
| -rw-r--r-- | sparse.1 | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -451,6 +451,12 @@ The concerned warnings are, for example, those triggered by Sparse does not issue these warnings by default, processing '{\ 0\ }' the same as '{\ }'. . +.TP +.B -Wunion-cast +Warn on casts to union types. + +Sparse does not issues these warnings by default. +. .SH MISC OPTIONS .TP .B \-\-arch=\fIARCH\fR |
