It turns out that just calling g_inet_address_get_type() isn't
enough, since its marked G_GNUC_CONST, so the call is optimized
away. If we assign the return value to a volatile location we ensure
it is called.
struct sockaddr_storage sa;
struct sockaddr_in *sin = (struct sockaddr_in *)&sa;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa;
+ volatile GType type;
gint len;
#else /* !G_OS_WIN32 */
struct in_addr in_addr;
#endif
/* Make sure _g_networking_init() has been called */
- (void) g_inet_address_get_type ();
+ type = g_inet_address_get_type ();
#ifdef G_OS_WIN32
memset (&sa, 0, sizeof (sa));