[gnio] Ensure g_inet_address_get_type call is not optimized away



commit aef616240651835768d8dec4d42b3c6bd8241ad0
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Apr 29 12:27:58 2009 +0200

    Ensure g_inet_address_get_type call is not optimized away
    
    Turns out that gcc optimizes away the G_GNUC_CONST call, so we need
    to assign the result somewhere.
---
 gio/gsocket.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gio/gsocket.c b/gio/gsocket.c
index 0b9ea72..4aa2d6f 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -469,9 +469,10 @@ static void
 g_socket_class_init (GSocketClass *klass)
 {
   GObjectClass *gobject_class G_GNUC_UNUSED = G_OBJECT_CLASS (klass);
+  volatile GType type;
 
   /* Make sure winsock has been initialized */
-  (void) g_inet_address_get_type ();
+  type = g_inet_address_get_type ();
 
   g_type_class_add_private (klass, sizeof (GSocketPrivate));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]