I have piece of code, which obtains local IPv6 address. gcc and clang with std=c99 crashes on those lines:
ipv6addr.s6_addr16[i] = htons((unsigned short int)tmp);
if (!(IN6_IS_ADDR_LOOPBACK(ipv6addr.s6_addr32)
|| IN6_IS_ADDR_UNSPECIFIED(ipv6addr.s6_addr32)
|| IN6_IS_ADDR_LINKLOCAL(ipv6addr.s6_addr32))){
ipv6.c:43:13: error: no member named 's6_addr16' in 'struct in6_addr'
ipv6addr.s6_addr16[i] = htons((unsigned short int)tmp);
~~~~~~~~ ^
ipv6.c:45:39: error: no member named 's6_addr32' in 'struct in6_addr'
if (!(IN6_IS_ADDR_LOOPBACK(ipv6addr.s6_addr32)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
etc.
Compiling with standard options results in success. Why is that? Full source is available at http://pastebin.com/hQ3VBSKe