Support GCC's transparent unions
commit7698bae699639892d639b8a9c270efdb8c46725c
authorJohn Keeping <john@keeping.me.uk>
Sun, 9 Mar 2014 11:32:51 +0000 (9 11:32 +0000)
committerChristopher Li <sparse@chrisli.org>
Tue, 1 Apr 2014 07:19:50 +0000 (1 00:19 -0700)
tree5b73fae2ac4791097fc63c973dbf098ae14d5de0
parent5798e4cf8fdb3090e4d4864e6d9824de69dfc786
Support GCC's transparent unions

This stops warnings in code using socket operations with a modern glibc,
which otherwise result in warnings of the form:

warning: incorrect type in argument 2 (invalid types)
   expected union __CONST_SOCKADDR_ARG [usertype] __addr
   got struct sockaddr *<noident>

Since transparent unions are only applicable to function arguments, we
create a new function to check that the types are compatible
specifically in this context.

Also change the wording of the existing warning slightly since sparse
does now support them.  The warning is left in case people want to avoid
using transparent unions.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
evaluate.c
parse.c
symbol.h
validation/transparent-union.c [new file with mode: 0644]