aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/eval/union-cast-no.c
AgeCommit message (Collapse)AuthorFilesLines
2020-08-17union-cast: teach sparse about union castsLuc Van Oostenryck1-1/+0
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>
2020-08-15union-cast: add some testcasesLuc Van Oostenryck1-0/+24
Casts to union type are a GCC extension and are similar to compound literals. However, sparse doesn't know about them and treats them like other casts to non-scalars. Add some testcases for this and its upcoming warning flag. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>