<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 15, 2015 at 4:53 AM, Ronny Chevalier <span dir="ltr"><<a href="mailto:chevalier.ronny@gmail.com" target="_blank">chevalier.ronny@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>2015-03-14 17:54 GMT+01:00 Shawn Landden <<a href="mailto:shawn@churchofgit.com" target="_blank">shawn@churchofgit.com</a>>:<br>
> On Sat, Mar 14, 2015 at 6:31 AM, Ronny Chevalier <<a href="mailto:chevalier.ronny@gmail.com" target="_blank">chevalier.ronny@gmail.com</a>><br>
> wrote:<br>
>><br>
>> 2015-03-11 4:42 GMT+01:00 Shawn Landden <<a href="mailto:shawn@churchofgit.com" target="_blank">shawn@churchofgit.com</a>>:<br>
>> > warning: pointer/integer type mismatch in conditional expression<br>
>> > ---<br>
>> >  src/shared/socket-util.c | 4 ++--<br>
>> >  1 file changed, 2 insertions(+), 2 deletions(-)<br>
>> ><br>
>> > diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c<br>
>> > index 5820279..73e1177 100644<br>
>> > --- a/src/shared/socket-util.c<br>
>> > +++ b/src/shared/socket-util.c<br>
>> > @@ -475,8 +475,8 @@ int sockaddr_port(const struct sockaddr *_sa) {<br>
>> >                  return -EAFNOSUPPORT;<br>
>> ><br>
>> >          return ntohs(sa->sa.sa_family == AF_INET6 ?<br>
>> > -                       sa->in6.sin6_port :<br>
>> > -                       sa->in.sin_port);<br>
>> > +                       (uint16_t)sa->in6.sin6_port :<br>
>> > +                       (uint16_t)sa->in.sin_port);<br>
>> >  }<br>
>> ><br>
>><br>
>> Hi,<br>
>><br>
>> I don't see any warning, and the man (man netinet_in.h) says that<br>
>> sin_port and sin6_port are of type in_port_t which is equivalent to<br>
>> uint16_t.<br>
><br>
><br>
> in_port_t and in6_port_t. If the type returned by a ternary operator is not<br>
> identical gcc-5 warns, even though they are both backed by uint16_t and thus<br>
> there is no violation.<br>
<br>
</div></div>netinet/in.h does not provide in6_port_t according to the manpage. I<br>
even check with the glibc and on master there is no mention of<br>
in6_port_t.<br>
Maybe you are using another libc?<br>
<div><div><br></div></div></blockquote><div>You are right, but has been a bug in an early gcc-5, which quite a few incorrect warnings.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
>><br>
>><br>
>> Maybe I'm missing something?<br>
>><br>
>> Ronny<br>
>> _______________________________________________<br>
>> systemd-devel mailing list<br>
>> <a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
>> <a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Shawn Landden<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Shawn Landden</div>
</div></div>