]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r305389:
authordim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)
committerdim <dim@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 7 Sep 2016 19:25:08 +0000 (19:25 +0000)
commit0cc3cdfde6255ac9f2a0ac8106f99e1eb62c0d9d
treeb71eec3c5938e28b090b740a31ad53c14a28f94d
parent17828b7413cf114e61c533bbbb136e171ca20271
MFC r305389:

With clang 3.9.0, compiling sys/netinet/igmp.c results in the following
warning:

sys/netinet/igmp.c:546:21: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion]
        p->ipopt_list[0] = IPOPT_RA;    /* Router Alert Option */
                         ~ ^~~~~~~~
sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA                148             /* router alert */
                                ^~~

This is because ipopt_list is an array of char, so IPOPT_RA is wrapped
to a negative value.  It would be nice to change ipopt_list to an array
of u_char, but it changes the signature of the public struct ipoption,
so add an explicit cast to suppress the warning.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D7777

git-svn-id: svn://svn.freebsd.org/base/stable/10@305558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netinet/igmp.c